org.deegree.geometry
Class GeometryFactory

java.lang.Object
  extended by org.deegree.geometry.SimpleGeometryFactory
      extended by org.deegree.geometry.GeometryFactory

public class GeometryFactory
extends SimpleGeometryFactory

Augments the SimpleGeometryFactory with additional methods for building complex Geometry and geometry-related objects (CurveSegments and SurfacePatches).

Author:
Markus Schneider, Andreas Poth, last edited by: $Author: mschneider $
See Also:
SimpleGeometryFactory, GeometryInspector

Field Summary
 
Fields inherited from class org.deegree.geometry.SimpleGeometryFactory
inspectors, pm
 
Constructor Summary
GeometryFactory()
           
GeometryFactory(PrecisionModel pm)
           
 
Method Summary
 Arc createArc(Point p1, Point p2, Point p3)
          Creates an Arc curve segment.
 ArcByBulge createArcByBulge(Point p1, Point p2, double bulge, Point normal)
          Creates an ArcByBulge curve segment.
 ArcByCenterPoint createArcByCenterPoint(Point midPoint, Length radius, Angle startAngle, Angle endAngle)
          Creates an ArcByCenterPoint curve segment.
 ArcString createArcString(Points points)
          Creates an ArcString curve segment.
 ArcStringByBulge createArcStringByBulge(Points points, double[] bulges, Points normals)
          Creates an ArcStringByBulge curve segment.
 Bezier createBezier(Points points, int degree, Knot knot1, Knot knot2)
          Creates a Bezier curve segment.
 BSpline createBSpline(Points points, int degree, List<Knot> knots, boolean isPolynomial)
          Creates a BSpline curve segment.
 Circle createCircle(Point p1, Point p2, Point p3)
          Creates a Circle curve segment.
 CircleByCenterPoint createCircleByCenterPoint(Point midPoint, Length radius, Angle startAngle)
          Creates an CircleByCenterPoint curve segment.
 Clothoid createClothoid(AffinePlacement referenceLocation, double scaleFactor, double startParameter, double endParameter)
          Creates a Clothoid curve segment.
 CompositeCurve createCompositeCurve(String id, ICRS crs, List<Curve> members)
          Creates a CompositeCurve from a list of passed Curves.
 CompositeGeometry<GeometricPrimitive> createCompositeGeometry(String id, ICRS crs, List<GeometricPrimitive> memberPrimitives)
          Creates a general CompositeGeometry from a list of primitive geometries.
 CompositeSolid createCompositeSolid(String id, ICRS crs, List<Solid> memberSolids)
          Creates a CompositeSolid from a list of passed Solids.
 CompositeSurface createCompositeSurface(String id, ICRS crs, List<Surface> memberSurfaces)
          Creates a CompositeSurface from a list of passed Surfaces.
 Cone createCone(List<Points> grid)
          Creates a Cone surface patch.
 CubicSpline createCubicSpline(Points points, Point vectorAtStart, Point vectorAtEnd)
          Creates a Clothoid curve segment.
 Curve createCurve(String id, ICRS crs, CurveSegment... segments)
          Creates a segmented Curve from one or more CurveSegments.
 Cylinder createCylinder(List<Points> grid)
          Creates a Cylinder surface patch.
 Geodesic createGeodesic(Point p1, Point p2)
          Creates a Geodesic curve segment.
 GeodesicString createGeodesicString(Points points)
          Creates a GeodesicString curve segment.
 GriddedSurfacePatch createGriddedSurfacePatch(List<Points> grid)
          Creates a GriddedSurfacePatch from the given list of points, each element denotes a row in the grid.
 LinearRing createLinearRing(String id, ICRS crs, Points points)
          Creates a simple LinearRing from a list of passed Points.
 LineStringSegment createLineStringSegment(Points points)
          Creates a LineStringSegment curve segment.
 MultiCurve createMultiCurve(String id, ICRS crs, List<Curve> members)
          Creates a MultiCurve from a list of passed Curves.
 MultiSolid createMultiSolid(String id, ICRS crs, List<Solid> members)
          Creates a MultiSolid from a list of passed Solids.
 MultiSurface createMultiSurface(String id, ICRS crs, List<Surface> members)
          Creates a MultiSurface from a list of passed Surfaces.
 OffsetCurve createOffsetCurve(Curve baseCurve, Point direction, Length distance)
          Creates an OffsetCurve curve segment.
 OrientableCurve createOrientableCurve(String id, ICRS crs, Curve baseCurve, boolean isReversed)
          Creates an OrientableCurve.
 OrientableSurface createOrientableSurface(String id, ICRS crs, Surface baseSurface, boolean isReversed)
          Creates an OrientableSurface.
 PolygonPatch createPolygonPatch(Ring exteriorRing, List<Ring> interiorRings)
          Creates a PolygonPatch surface patch.
 PolyhedralSurface createPolyhedralSurface(String id, ICRS crs, List<PolygonPatch> memberPatches)
          Creates a PolyhedralSurface.
 Rectangle createRectangle(LinearRing exterior)
          Creates a Rectangle surface patch.
 Ring createRing(String id, ICRS crs, List<Curve> members)
          Creates a Ring from a list of passed Curves.
 Solid createSolid(String id, ICRS crs, Surface exteriorSurface, List<Surface> interiorSurfaces)
          Creates a Solid.
 Sphere createSphere(List<Points> grid)
          Creates a Sphere surface patch.
 Surface createSurface(String id, List<SurfacePatch> patches, ICRS crs)
          Creates a Surface that consists of a number of SurfacePatch instances.
 Tin createTin(String id, ICRS crs, List<List<LineStringSegment>> stopLines, List<List<LineStringSegment>> breakLines, Length maxLength, Points controlPoints, List<Triangle> patches)
          Creates a Tin.
 Triangle createTriangle(LinearRing exterior)
          Creates a Triangle surface patch.
 TriangulatedSurface createTriangulatedSurface(String id, ICRS crs, List<Triangle> memberPatches)
          Creates a TriangulatedSurface.
 
Methods inherited from class org.deegree.geometry.SimpleGeometryFactory
addInspector, createEnvelope, createEnvelope, createEnvelope, createLineString, createMultiGeometry, createMultiLineString, createMultiPoint, createMultiPolygon, createPoint, createPoint, createPoint, createPoints, createPolygon, inspect, inspect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryFactory

public GeometryFactory()

GeometryFactory

public GeometryFactory(PrecisionModel pm)
Method Detail

createCurve

public Curve createCurve(String id,
                         ICRS crs,
                         CurveSegment... segments)
Creates a segmented Curve from one or more CurveSegments. The last Point of segment i must equal the first Point of segment i+1.

Parameters:
id - identifier of the new geometry instance
crs - coordinate reference system
segments - segments a curve shall be created from
Returns:
created Curve

createLineStringSegment

public LineStringSegment createLineStringSegment(Points points)
Creates a LineStringSegment curve segment.

Parameters:
points - points to create the LineStringSegment from
Returns:
created CurveSegment

createArc

public Arc createArc(Point p1,
                     Point p2,
                     Point p3)
Creates an Arc curve segment.

Parameters:
p1 - first control point
p2 - second control point
p3 - third control point
Returns:
created Arc

createArcByBulge

public ArcByBulge createArcByBulge(Point p1,
                                   Point p2,
                                   double bulge,
                                   Point normal)
Creates an ArcByBulge curve segment.

Parameters:
p1 - first control point
p2 - second control point
bulge - height of the arc (multiplier for the normals)
normal - normal vector, in 2D only one coordinate is necessary
Returns:
created ArcStringByBulge

createArcByCenterPoint

public ArcByCenterPoint createArcByCenterPoint(Point midPoint,
                                               Length radius,
                                               Angle startAngle,
                                               Angle endAngle)
Creates an ArcByCenterPoint curve segment.

Parameters:
midPoint -
radius -
startAngle -
endAngle -
Returns:
created ArcByCenterPoint

createArcString

public ArcString createArcString(Points points)
Creates an ArcString curve segment.

Parameters:
points - control points, must contain 2 * k + 1 points (k >= 1)
Returns:
created ArcString

createArcStringByBulge

public ArcStringByBulge createArcStringByBulge(Points points,
                                               double[] bulges,
                                               Points normals)
Creates an ArcStringByBulge curve segment.

This variant of the arc computes the mid points of the arcs instead of storing the coordinates directly. The control point sequence consists of the start and end points of each arc plus the bulge.

Parameters:
points - list of control points, must contain at least two points
bulges - heights of the arcs (multipliers for the normals)
normals - normal vectors
Returns:
created ArcStringByBulge

createBezier

public Bezier createBezier(Points points,
                           int degree,
                           Knot knot1,
                           Knot knot2)
Creates a Bezier curve segment.

Parameters:
points - list of control points
degree - polynomial degree of the spline
knot1 - first of the two knots that define the spline basis functions
knot2 - second of the two knots that define the spline basis functions
Returns:
created Bezier

createBSpline

public BSpline createBSpline(Points points,
                             int degree,
                             List<Knot> knots,
                             boolean isPolynomial)
Creates a BSpline curve segment.

Parameters:
points - list of control points
degree - polynomial degree of the spline
knots - sequence of distinct knots that define the spline basis functions
isPolynomial - set to true if this is a polynomial spline, otherwise it's a rational spline
Returns:
created BSpline

createCircle

public Circle createCircle(Point p1,
                           Point p2,
                           Point p3)
Creates a Circle curve segment.

Parameters:
p1 - first control point
p2 - second control point
p3 - third control point
Returns:
created Arc

createCircleByCenterPoint

public CircleByCenterPoint createCircleByCenterPoint(Point midPoint,
                                                     Length radius,
                                                     Angle startAngle)
Creates an CircleByCenterPoint curve segment.

Parameters:
midPoint -
radius -
startAngle -
Returns:
created CircleByCenterPoint

createGeodesic

public Geodesic createGeodesic(Point p1,
                               Point p2)
Creates a Geodesic curve segment.

Parameters:
p1 - first control point
p2 - second control point
Returns:
created Geodesic

createGeodesicString

public GeodesicString createGeodesicString(Points points)
Creates a GeodesicString curve segment.

Parameters:
points - control points, at least two
Returns:
created GeodesicString

createOffsetCurve

public OffsetCurve createOffsetCurve(Curve baseCurve,
                                     Point direction,
                                     Length distance)
Creates an OffsetCurve curve segment.

Parameters:
baseCurve - the base geometry
direction - the direction of the offset
distance - the distance from the base curve
Returns:
created GeodesicString

createSurface

public Surface createSurface(String id,
                             List<SurfacePatch> patches,
                             ICRS crs)
Creates a Surface that consists of a number of SurfacePatch instances. The passed patches must touch in a topological sense to form a valid Surface.

Parameters:
id - identifier of the new geometry instance
patches - patches to create a surface
crs - coordinate reference system, may be null
Returns:
created Surface

createPolygonPatch

public PolygonPatch createPolygonPatch(Ring exteriorRing,
                                       List<Ring> interiorRings)
Creates a PolygonPatch surface patch.

Parameters:
exteriorRing - ring that defines the outer boundary, this may be null (see section 9.2.2.5 of GML spec)
interiorRings - list of rings that define the inner boundaries, may be empty or null
Returns:
created PolygonPatch

createRing

public Ring createRing(String id,
                       ICRS crs,
                       List<Curve> members)
Creates a Ring from a list of passed Curves.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
members - the Curves that compose the Ring
Returns:
created Ring

createLinearRing

public LinearRing createLinearRing(String id,
                                   ICRS crs,
                                   Points points)
Creates a simple LinearRing from a list of passed Points.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
points - control points
Returns:
created Ring

createOrientableCurve

public OrientableCurve createOrientableCurve(String id,
                                             ICRS crs,
                                             Curve baseCurve,
                                             boolean isReversed)
Creates an OrientableCurve.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
baseCurve - base curve
isReversed - set to true, if the orientation of the base curve shall be reversed in the created geometry
Returns:
created OrientableCurve

createTriangle

public Triangle createTriangle(LinearRing exterior)
Creates a Triangle surface patch.

Parameters:
exterior - ring that contains exactly four planar points, the first and last point must be coincident
Returns:
created Triangle

createRectangle

public Rectangle createRectangle(LinearRing exterior)
Creates a Rectangle surface patch.

Parameters:
exterior - ring that contains exactly five planar points, the first and last point must match
Returns:
created Rectangle

createOrientableSurface

public OrientableSurface createOrientableSurface(String id,
                                                 ICRS crs,
                                                 Surface baseSurface,
                                                 boolean isReversed)
Creates an OrientableSurface.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
baseSurface - base surface
isReversed - set to true, if the orientation of the base surface shall be reversed
Returns:
created OrientableCurve

createPolyhedralSurface

public PolyhedralSurface createPolyhedralSurface(String id,
                                                 ICRS crs,
                                                 List<PolygonPatch> memberPatches)
Creates a PolyhedralSurface.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
memberPatches - patches that constitute the surface
Returns:
created PolyhedralSurface

createTriangulatedSurface

public TriangulatedSurface createTriangulatedSurface(String id,
                                                     ICRS crs,
                                                     List<Triangle> memberPatches)
Creates a TriangulatedSurface.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
memberPatches - patches that constitute the surface
Returns:
created TriangulatedSurface

createTin

public Tin createTin(String id,
                     ICRS crs,
                     List<List<LineStringSegment>> stopLines,
                     List<List<LineStringSegment>> breakLines,
                     Length maxLength,
                     Points controlPoints,
                     List<Triangle> patches)
Creates a Tin.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
stopLines -
breakLines -
maxLength -
controlPoints -
patches -
Returns:
created Tin

createClothoid

public Clothoid createClothoid(AffinePlacement referenceLocation,
                               double scaleFactor,
                               double startParameter,
                               double endParameter)
Creates a Clothoid curve segment.

Parameters:
referenceLocation - the affine mapping that places the curve defined by the Fresnel Integrals into the coordinate reference system of this object
scaleFactor - the value for the constant in the Fresnel's integrals
startParameter - the arc length distance from the inflection point that will be the start point for this curve segment
endParameter - the arc length distance from the inflection point that will be the end point for this curve segment
Returns:
created Clothoid

createCone

public Cone createCone(List<Points> grid)
Creates a Cone surface patch.

Parameters:
grid - the grid of control points that defines the Cone
Returns:
created Cone

createCylinder

public Cylinder createCylinder(List<Points> grid)
Creates a Cylinder surface patch.

Parameters:
grid - the grid of control points that defines the Cylinder
Returns:
created Cylinder

createSphere

public Sphere createSphere(List<Points> grid)
Creates a Sphere surface patch.

Parameters:
grid - the grid of control points that defines the Sphere
Returns:
created Sphere

createCubicSpline

public CubicSpline createCubicSpline(Points points,
                                     Point vectorAtStart,
                                     Point vectorAtEnd)
Creates a Clothoid curve segment.

Parameters:
points - control points, at least two
vectorAtStart - the unit tangent vector at the start point of the spline
vectorAtEnd - the unit tangent vector at the end point of the spline
Returns:
created Clothoid

createSolid

public Solid createSolid(String id,
                         ICRS crs,
                         Surface exteriorSurface,
                         List<Surface> interiorSurfaces)
Creates a Solid.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
exteriorSurface - the exterior surface (shell) of the solid, may be null
interiorSurfaces - the interior surfaces of the solid, may be null or empty
Returns:
created Solid

createMultiCurve

public MultiCurve createMultiCurve(String id,
                                   ICRS crs,
                                   List<Curve> members)
Creates a MultiCurve from a list of passed Curves.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
members - curves that constitute the collection
Returns:
created MultiCurve

createMultiSurface

public MultiSurface createMultiSurface(String id,
                                       ICRS crs,
                                       List<Surface> members)
Creates a MultiSurface from a list of passed Surfaces.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
members - surfaces that constitute the collection
Returns:
created MultiSurface

createMultiSolid

public MultiSolid createMultiSolid(String id,
                                   ICRS crs,
                                   List<Solid> members)
Creates a MultiSolid from a list of passed Solids.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
members - solids that constitute the collection
Returns:
created MultiSolid

createCompositeCurve

public CompositeCurve createCompositeCurve(String id,
                                           ICRS crs,
                                           List<Curve> members)
Creates a CompositeCurve from a list of passed Curves.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
members - curves that constitute the composited curve, each curve must end at the start point of the subsequent curve in the list
Returns:
created CompositeCurve

createCompositeSurface

public CompositeSurface createCompositeSurface(String id,
                                               ICRS crs,
                                               List<Surface> memberSurfaces)
Creates a CompositeSurface from a list of passed Surfaces.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
memberSurfaces - surfaces that constitute the composited surface, the surfaces must join in pairs on common boundary curves and must, when considered as a whole, form a single surface
Returns:
created CompositeSurface

createCompositeSolid

public CompositeSolid createCompositeSolid(String id,
                                           ICRS crs,
                                           List<Solid> memberSolids)
Creates a CompositeSolid from a list of passed Solids.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
memberSolids - solids that constitute the composited solid, the solids must join in pairs on common boundary surfaces and which, when considered as a whole, form a single solid
Returns:
created CompositeSolid

createCompositeGeometry

public CompositeGeometry<GeometricPrimitive> createCompositeGeometry(String id,
                                                                     ICRS crs,
                                                                     List<GeometricPrimitive> memberPrimitives)
Creates a general CompositeGeometry from a list of primitive geometries.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
memberPrimitives -
Returns:
created CompositeGeometry

createGriddedSurfacePatch

public GriddedSurfacePatch createGriddedSurfacePatch(List<Points> grid)
Creates a GriddedSurfacePatch from the given list of points, each element denotes a row in the grid.

Parameters:
grid - containing the rows of the grid.
Returns:
a new GriddedSurfacePatch.


Copyright © 2011. All Rights Reserved.