org.deegree.geometry
Class SimpleGeometryFactory

java.lang.Object
  extended by org.deegree.geometry.SimpleGeometryFactory
Direct Known Subclasses:
GeometryFactory

public class SimpleGeometryFactory
extends Object

Supplies utility methods for building simple Geometry objects.

Author:
Markus Schneider, last edited by: $Author: mschneider $
See Also:
GeometryFactory, GeometryInspector

Field Summary
protected  List<GeometryInspector> inspectors
           
protected  PrecisionModel pm
           
 
Constructor Summary
SimpleGeometryFactory()
           
SimpleGeometryFactory(PrecisionModel pm)
           
 
Method Summary
 void addInspector(GeometryInspector inspector)
          Adds the given GeometryInspector which will be invoked for every Geometry / CurveSegment or SurfacePatch instance created by this factory.
 Envelope createEnvelope(double[] min, double[] max, ICRS crs)
          Creates an Envelope.
 Envelope createEnvelope(double minx, double miny, double maxx, double maxy, ICRS crs)
          Creates an Envelope in 2D space.
 Envelope createEnvelope(List<Double> lowerCorner, List<Double> upperCorner, ICRS crs)
          Create an Envelope from a list of Doubles.
 LineString createLineString(String id, ICRS crs, Points points)
          Creates a LineString geometry.
 MultiGeometry<Geometry> createMultiGeometry(String id, ICRS crs, List<Geometry> members)
          Creates an untyped multi geometry from a list of Geometrys.
 MultiLineString createMultiLineString(String id, ICRS crs, List<LineString> members)
          Creates a MultiCurve from a list of passed LineStrings.
 MultiPoint createMultiPoint(String id, ICRS crs, List<Point> members)
          Creates a MultiPoint from a list of passed Points.
 MultiPolygon createMultiPolygon(String id, ICRS crs, List<Polygon> members)
          Creates a MultiPolygon from a list of passed Polygons.
 Point createPoint(String id, double[] coordinates, ICRS crs)
          Creates a Point with an arbitrary number of coordinates.
 Point createPoint(String id, double x, double y, double z, ICRS crs)
          Creates a Point in 3D space.
 Point createPoint(String id, double x, double y, ICRS crs)
          Creates a Point in 2D space.
 Points createPoints(List<Point> points)
          Creates a Points object from the given list of Point instances.
 Polygon createPolygon(String id, ICRS crs, Ring exteriorRing, List<Ring> interiorRings)
          Creates a Polygon surface.
protected  Geometry inspect(Geometry geom)
           
protected  Points inspect(Points points)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inspectors

protected List<GeometryInspector> inspectors

pm

protected PrecisionModel pm
Constructor Detail

SimpleGeometryFactory

public SimpleGeometryFactory()

SimpleGeometryFactory

public SimpleGeometryFactory(PrecisionModel pm)
Method Detail

addInspector

public void addInspector(GeometryInspector inspector)
Adds the given GeometryInspector which will be invoked for every Geometry / CurveSegment or SurfacePatch instance created by this factory.

Parameters:
inspector - inspector to be added, must not be null

inspect

protected Geometry inspect(Geometry geom)

inspect

protected Points inspect(Points points)

createPoint

public Point createPoint(String id,
                         double x,
                         double y,
                         ICRS crs)
Creates a Point in 2D space.

Parameters:
id - identifier, may be null
x - value for first coordinate
y - value for second coordinate
crs - coordinate reference system, may be null
Returns:
created Point

createPoint

public Point createPoint(String id,
                         double x,
                         double y,
                         double z,
                         ICRS crs)
Creates a Point in 3D space.

Parameters:
id - identifier, may be null
x - value for first coordinate
y - value for second coordinate
z - value for third coordinate
crs - coordinate reference system, may be null
Returns:
created Point

createPoint

public Point createPoint(String id,
                         double[] coordinates,
                         ICRS crs)
Creates a Point with an arbitrary number of coordinates.

Parameters:
id - identifier, may be null
coordinates - coordinate values
crs - coordinate reference system, may be null
Returns:
created Point

createPoints

public Points createPoints(List<Point> points)
Creates a Points object from the given list of Point instances.

Parameters:
points - list of points, must not be null
Returns:
created Points

createPolygon

public Polygon createPolygon(String id,
                             ICRS crs,
                             Ring exteriorRing,
                             List<Ring> interiorRings)
Creates a Polygon surface.

Parameters:
id - identifier of the new geometry instance
crs - coordinate reference system, may be null
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 Polygon

createLineString

public LineString createLineString(String id,
                                   ICRS crs,
                                   Points points)
Creates a LineString geometry.

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

createEnvelope

public Envelope createEnvelope(double[] min,
                               double[] max,
                               ICRS crs)
Creates an Envelope.

Parameters:
min - minimum corner coordinates
max - maximum corner coordinates
crs - coordinate reference system, may be null
Returns:
created Envelope

createEnvelope

public Envelope createEnvelope(double minx,
                               double miny,
                               double maxx,
                               double maxy,
                               ICRS crs)
Creates an Envelope in 2D space.

Parameters:
minx - minimum x corner coordinate
miny - minimum y corner coordinate
maxx - maximum x corner coordinate
maxy - maximum y corner coordinate
crs - coordinate reference system, may be null
Returns:
created Envelope

createEnvelope

public Envelope createEnvelope(List<Double> lowerCorner,
                               List<Double> upperCorner,
                               ICRS crs)
Create an Envelope from a list of Doubles.

Parameters:
lowerCorner -
upperCorner -
crs - coordinate reference system, may be null
Returns:
the envelope

createMultiGeometry

public MultiGeometry<Geometry> createMultiGeometry(String id,
                                                   ICRS crs,
                                                   List<Geometry> members)
Creates an untyped multi geometry from a list of Geometrys.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
members -
Returns:
created MultiGeometry

createMultiPoint

public MultiPoint createMultiPoint(String id,
                                   ICRS crs,
                                   List<Point> members)
Creates a MultiPoint from a list of passed Points.

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

createMultiLineString

public MultiLineString createMultiLineString(String id,
                                             ICRS crs,
                                             List<LineString> members)
Creates a MultiCurve from a list of passed LineStrings.

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

createMultiPolygon

public MultiPolygon createMultiPolygon(String id,
                                       ICRS crs,
                                       List<Polygon> members)
Creates a MultiPolygon from a list of passed Polygons.

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


Copyright © 2011. All Rights Reserved.