deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.spatialschema
Class GeometryFactory

java.lang.Object
  extended by org.deegree.model.spatialschema.GeometryFactory

public final class GeometryFactory
extends Object

Factory to create geometry instances.

Version:
$Revision: 19316 $, $Date: 2009-08-24 18:14:33 +0200 (Mo, 24. Aug 2009) $
Author:
Andreas Poth

Method Summary
static Curve createCurve(byte[] wkb, CoordinateSystem crs)
          creates a Curve from a wkb.
static Curve createCurve(CurveSegment segment)
          creates a Curve from one curve segment.
static Curve createCurve(CurveSegment[] segments)
          creates a Curve from an array of curve segments.
static Curve createCurve(CurveSegment[] segments, CoordinateSystem crs)
          creates a Curve from an array of curve segments.
static Curve createCurve(double[] ord, int dim, CoordinateSystem crs)
          creates a GM_Curve from an array of ordinates TODO: If resources are available, think about good programming style.
static Curve createCurve(List<CurveSegment> segments, CoordinateSystem crs)
           
static Curve createCurve(Position[] positions, CoordinateSystem crs)
          creates a Curve from an array of Positions.
static Curve createCurveAsArc(double centerX, double centerY, double radiusX, double radiusY, int nSeg, double start, double end, CoordinateSystem crs)
           
static CurveSegment createCurveSegment(List<Position> points, CoordinateSystem crs)
           
static CurveSegment createCurveSegment(Position[] points, CoordinateSystem crs)
          creates a CurveSegment from an array of points.
static Envelope createEnvelope(double minx, double miny, double maxx, double maxy, CoordinateSystem crs)
          creates a Envelope object out from two corner coordinates
static Envelope createEnvelope(Position min, Position max, CoordinateSystem crs)
          creates a Envelope object out from two corner coordinates
static Envelope createEnvelope(String bbox, CoordinateSystem crs)
          creates an Envelope from a comma seperated String; e.g.: 10,34,15,48
static MultiCurve createMultiCurve(byte[] wkb, CoordinateSystem crs)
          creates a MultiCurve from a wkb.
static MultiCurve createMultiCurve(Curve[] curves)
          creates a MultiCurve from an array of Curves.
static MultiCurve createMultiCurve(Curve[] curves, CoordinateSystem crs)
          creates a MultiCurve from an array of Curves.
static MultiGeometry createMultiGeometry(byte[] wkb, CoordinateSystem crs)
          Creates a MultiGeometry from an array of Geometry objects.
static MultiGeometry createMultiGeometry(Geometry[] members, CoordinateSystem crs)
          Creates a MultiGeometry from an array of Geometry objects.
static MultiPoint createMultiPoint(byte[] wkb, CoordinateSystem crs)
          creates a MultiPoint from a wkb.
static MultiPoint createMultiPoint(Point[] points)
          creates a MultiPoint from an array of Point.
static MultiPoint createMultiPoint(Point[] points, CoordinateSystem crs)
          creates a MultiPoint from an array of Point.
static MultiSurface createMultiSurface(byte[] wkb, CoordinateSystem crs, SurfaceInterpolation si)
          creates a MultiSurface from a wkb
static MultiSurface createMultiSurface(Surface[] surfaces)
          creates a MultiSurface from an array of surfaces
static MultiSurface createMultiSurface(Surface[] surfaces, CoordinateSystem crs)
          creates a MultiSurface from an array of surfaces
static Point createPoint(byte[] wkb, CoordinateSystem srs)
          creates a Point from a wkb.
static Point createPoint(double x, double y, CoordinateSystem crs)
          creates a Point from two coordinates.
static Point createPoint(double x, double y, double z, CoordinateSystem crs)
          creates a Point from two coordinates.
static Point createPoint(Position position, CoordinateSystem crs)
          creates a Point from a position.
static Position createPosition(double[] p)
          creates a Position from an array of double.
static Position createPosition(double x, double y)
          creates a Position from two coordinates.
static Position createPosition(double x, double y, double z)
          creates a Position from three coordinates.
static Position createPosition(javax.vecmath.Point3d coordinates)
          creates a Position from a point3d.
static Surface createSurface(byte[] wkb, CoordinateSystem crs, SurfaceInterpolation si)
          creates a Surface from a wkb.
static Surface createSurface(double[] exterior, double[][] interior, int dim, CoordinateSystem crs)
          Creates a GM_Surface from the ordinates of the exterior ring and the the interior rings
static Surface createSurface(Envelope bbox, CoordinateSystem crs)
          Creates a Surface from a Envelope.
static Surface createSurface(Position[] exteriorRing, Position[][] interiorRings, SurfaceInterpolation si, CoordinateSystem crs)
          creates a Surface composed of one SurfacePatch from array(s) of Position
static Surface createSurface(SurfacePatch patch)
          creates a Surface from an array of SurfacePatch.
static Surface createSurface(SurfacePatch[] patches)
          creates a Surface from an array of SurfacePatch.
static Surface createSurface(SurfacePatch[] patches, CoordinateSystem crs)
          creates a Surface from an array of SurfacePatch.
static Surface createSurfaceAsEllipse(double centerX, double centerY, double radiusX, double radiusY, int nSeg, CoordinateSystem crs)
          creates a surface in form of an ellipse.
static SurfacePatch createSurfacePatch(Curve exteriorRing, Curve[] interiorRings, CoordinateSystem crs)
           
static SurfacePatch createSurfacePatch(CurveSegment[] exteriorRing, CurveSegment[][] interiorRings, CoordinateSystem crs)
           
static SurfacePatch createSurfacePatch(Position[] exteriorRing, Position[][] interiorRings, SurfaceInterpolation si, CoordinateSystem crs)
          creates a SurfacePatch from array(s) of Position
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createEnvelope

public static Envelope createEnvelope(double minx,
                                      double miny,
                                      double maxx,
                                      double maxy,
                                      CoordinateSystem crs)
creates a Envelope object out from two corner coordinates

Parameters:
minx - lower x-axis coordinate
miny - lower y-axis coordinate
maxx - upper x-axis coordinate
maxy - upper y-axis coordinate
crs - The coordinate system
Returns:
an Envelope with given parameters

createEnvelope

public static Envelope createEnvelope(Position min,
                                      Position max,
                                      CoordinateSystem crs)
creates a Envelope object out from two corner coordinates

Parameters:
min - lower point
max - upper point
crs - The coordinate system
Returns:
an Envelope with given parameters

createEnvelope

public static Envelope createEnvelope(String bbox,
                                      CoordinateSystem crs)
creates an Envelope from a comma seperated String; e.g.: 10,34,15,48

Parameters:
bbox - the boundingbox of the created Envelope
crs - The coordinate system
Returns:
an Envelope with given parameters

createPosition

public static Position createPosition(double x,
                                      double y)
creates a Position from two coordinates.

Parameters:
x - coordinate on the x-axis
y - coordinate on the y-axis
Returns:
a Position defining position x, y

createPosition

public static Position createPosition(double x,
                                      double y,
                                      double z)
creates a Position from three coordinates.

Parameters:
x - coordinate on the x-axis
y - coordinate on the y-axis
z - coordinate on the z-axis
Returns:
a Position defining position x, y, z

createPosition

public static Position createPosition(javax.vecmath.Point3d coordinates)
creates a Position from a point3d.

Parameters:
coordinates - the coordinates to create the position from.
Returns:
a Position defining position x, y, z

createPosition

public static Position createPosition(double[] p)
creates a Position from an array of double.

Parameters:
p - list of points
Returns:
the Position defined by the array.

createPoint

public static Point createPoint(double x,
                                double y,
                                CoordinateSystem crs)
creates a Point from two coordinates.

Parameters:
x - x coordinate
y - y coordinate
crs - spatial reference system of the point geometry
Returns:
a Position defining position x, y in the given CRS

createPoint

public static Point createPoint(double x,
                                double y,
                                double z,
                                CoordinateSystem crs)
creates a Point from two coordinates.

Parameters:
x - x coordinate
y - y coordinate
z - coordinate on the z-axis
crs - spatial reference system of the point geometry
Returns:
a Position defining position x, y, z in the given CRS

createPoint

public static Point createPoint(Position position,
                                CoordinateSystem crs)
creates a Point from a position.

Parameters:
position - position
crs - spatial reference system of the point geometry
Returns:
the Position defined by the array in the given CRS

createPoint

public static Point createPoint(byte[] wkb,
                                CoordinateSystem srs)
                         throws GeometryException
creates a Point from a wkb.

Parameters:
wkb - geometry in Well-Known Binary (WKB) format
srs - spatial reference system of the geometry
Returns:
the Position defined by the WKB and the given CRS
Throws:
GeometryException - if the wkb is not known or invalid

createCurveSegment

public static CurveSegment createCurveSegment(Position[] points,
                                              CoordinateSystem crs)
                                       throws GeometryException
creates a CurveSegment from an array of points.

Parameters:
points - array of Point
crs - CS_CoordinateSystem spatial reference system of the curve
Returns:
A curve defined by the given Points in the CRS.
Throws:
GeometryException - if the point array is empty

createCurveSegment

public static CurveSegment createCurveSegment(List<Position> points,
                                              CoordinateSystem crs)
                                       throws GeometryException
Parameters:
points -
crs -
Returns:
a new curve segment
Throws:
GeometryException

createCurve

public static Curve createCurve(Position[] positions,
                                CoordinateSystem crs)
                         throws GeometryException
creates a Curve from an array of Positions.

Parameters:
positions - positions
crs - spatial reference system of the geometry
Returns:
A curve defined by the given Points in the CRS.
Throws:
GeometryException - if the point array is empty

createCurve

public static Curve createCurve(CurveSegment segment)
                         throws GeometryException
creates a Curve from one curve segment.

Parameters:
segment - CurveSegments
Returns:
a new CurveSegment
Throws:
GeometryException - if the segment is null

createCurve

public static Curve createCurve(CurveSegment[] segments)
                         throws GeometryException
creates a Curve from an array of curve segments.

Parameters:
segments - array of CurveSegments
Returns:
a new CurveSegment
Throws:
GeometryException - if the segment is null or has no values

createCurve

public static Curve createCurve(CurveSegment[] segments,
                                CoordinateSystem crs)
                         throws GeometryException
creates a Curve from an array of curve segments.

Parameters:
segments - array of CurveSegments
crs -
Returns:
a new CurveSegment
Throws:
GeometryException - if the segment is null or has no values

createCurve

public static Curve createCurve(List<CurveSegment> segments,
                                CoordinateSystem crs)
                         throws GeometryException
Parameters:
segments -
crs -
Returns:
a new curve
Throws:
GeometryException

createCurve

public static Curve createCurve(double[] ord,
                                int dim,
                                CoordinateSystem crs)
                         throws GeometryException
creates a GM_Curve from an array of ordinates TODO: If resources are available, think about good programming style.

Parameters:
ord - the ordinates
dim - the dimension of the ordinates
crs - the spatial reference system of the geometry
Returns:
the Curve defined by the given parameters
Throws:
GeometryException - if the ord array is empty

createSurfacePatch

public static SurfacePatch createSurfacePatch(Position[] exteriorRing,
                                              Position[][] interiorRings,
                                              SurfaceInterpolation si,
                                              CoordinateSystem crs)
                                       throws GeometryException
creates a SurfacePatch from array(s) of Position

Parameters:
exteriorRing - exterior ring of the patch
interiorRings - interior rings of the patch
si - SurfaceInterpolation
crs - CS_CoordinateSystem spatial reference system of the surface patch
Returns:
a Surfacepatch defined by the given Parameters
Throws:
GeometryException

createSurfacePatch

public static SurfacePatch createSurfacePatch(CurveSegment[] exteriorRing,
                                              CurveSegment[][] interiorRings,
                                              CoordinateSystem crs)
                                       throws GeometryException
Parameters:
exteriorRing -
interiorRings -
crs -
Returns:
the surface path create from the given parameters.
Throws:
GeometryException

createSurfacePatch

public static SurfacePatch createSurfacePatch(Curve exteriorRing,
                                              Curve[] interiorRings,
                                              CoordinateSystem crs)
                                       throws GeometryException
Parameters:
exteriorRing -
interiorRings -
crs -
Returns:
the surfacepatch created from the given parameters.
Throws:
GeometryException

createCurveAsArc

public static Curve createCurveAsArc(double centerX,
                                     double centerY,
                                     double radiusX,
                                     double radiusY,
                                     int nSeg,
                                     double start,
                                     double end,
                                     CoordinateSystem crs)
                              throws GeometryException
Parameters:
centerX - x coordinate of the center of the ellipse the arc is part of
centerY - y coordinate of the center of the ellipse the arc is part of
radiusX - radius in x-direction of the ellipse the arc is part of
radiusY - radius in y-direction of the ellipse the arc is part of
nSeg - number of segments
start - start angle of the arc
end - end angle of the arc
crs -
Returns:
a Curve representing an arc
Throws:
GeometryException

createCurve

public static Curve createCurve(byte[] wkb,
                                CoordinateSystem crs)
                         throws GeometryException
creates a Curve from a wkb.

Parameters:
wkb - byte stream that contains the wkb information
crs - CS_CoordinateSystem spatial reference system of the curve
Returns:
the Curve defined by the WKB and the given CRS
Throws:
GeometryException - if the wkb is not known or invalid

createSurfaceAsEllipse

public static Surface createSurfaceAsEllipse(double centerX,
                                             double centerY,
                                             double radiusX,
                                             double radiusY,
                                             int nSeg,
                                             CoordinateSystem crs)
                                      throws GeometryException
creates a surface in form of an ellipse. If radiusX == radiusY a circle will be created

Parameters:
centerX -
centerY -
radiusX -
radiusY -
nSeg - number of segments the ellipse will have
crs -
Throws:
GeometryException

createSurface

public static Surface createSurface(Position[] exteriorRing,
                                    Position[][] interiorRings,
                                    SurfaceInterpolation si,
                                    CoordinateSystem crs)
                             throws GeometryException
creates a Surface composed of one SurfacePatch from array(s) of Position

Parameters:
exteriorRing - exterior ring of the patch
interiorRings - interior rings of the patch
si - SurfaceInterpolation
crs - CS_CoordinateSystem spatial reference system of the surface patch
Returns:
a Surface composed of one SurfacePatch from array(s) of Position
Throws:
GeometryException - if the implicite orientation is not '+' or '-', or the rings aren't closed

createSurface

public static Surface createSurface(SurfacePatch patch)
                             throws GeometryException
creates a Surface from an array of SurfacePatch.

Parameters:
patch - patches that build the surface
Returns:
a Surface from an array of SurfacePatch.
Throws:
GeometryException - if implicite the orientation is not '+' or '-'

createSurface

public static Surface createSurface(SurfacePatch[] patches)
                             throws GeometryException
creates a Surface from an array of SurfacePatch.

Parameters:
patches - patches that build the surface
Returns:
a Surface from an array of SurfacePatch.
Throws:
GeometryException - if implicite the orientation is not '+' or '-'

createSurface

public static Surface createSurface(SurfacePatch[] patches,
                                    CoordinateSystem crs)
                             throws GeometryException
creates a Surface from an array of SurfacePatch.

Parameters:
patches - patches that build the surface
crs -
Returns:
a Surface from an array of SurfacePatch.
Throws:
GeometryException - if implicite the orientation is not '+' or '-'

createSurface

public static Surface createSurface(byte[] wkb,
                                    CoordinateSystem crs,
                                    SurfaceInterpolation si)
                             throws GeometryException
creates a Surface from a wkb.

Parameters:
wkb - byte stream that contains the wkb information
crs - CS_CoordinateSystem spatial reference system of the curve
si - SurfaceInterpolation
Returns:
a Surface from a wkb.
Throws:
GeometryException - if the implicite orientation is not '+' or '-' or the wkb is not known or invalid

createSurface

public static Surface createSurface(Envelope bbox,
                                    CoordinateSystem crs)
                             throws GeometryException
Creates a Surface from a Envelope.

Parameters:
bbox - envelope to be converted
crs - spatial reference system of the surface
Returns:
corresponding surface
Throws:
GeometryException - if the implicite orientation is not '+' or '-'

createSurface

public static Surface createSurface(double[] exterior,
                                    double[][] interior,
                                    int dim,
                                    CoordinateSystem crs)
                             throws GeometryException
Creates a GM_Surface from the ordinates of the exterior ring and the the interior rings

Parameters:
exterior - ring
interior - ring
dim - of the surface
crs - spatial reference system of the surface
Returns:
corresponding surface
Throws:
GeometryException - if the implicite orientation is not '+' or '-'

createMultiGeometry

public static MultiGeometry createMultiGeometry(Geometry[] members,
                                                CoordinateSystem crs)
Creates a MultiGeometry from an array of Geometry objects.

Parameters:
members - member geometries
crs - coordinate system
Returns:
MultiGeometry that contains all given members

createMultiGeometry

public static MultiGeometry createMultiGeometry(byte[] wkb,
                                                CoordinateSystem crs)
                                         throws GeometryException
Creates a MultiGeometry from an array of Geometry objects.

Parameters:
wkb - wkb information
crs - coordinate system
Returns:
MultiGeometry that contains all given members
Throws:
GeometryException - if the wkb is not known or invalid

createMultiPoint

public static MultiPoint createMultiPoint(Point[] points)
creates a MultiPoint from an array of Point.

Parameters:
points - array of Points
Returns:
a MultiPoint from an array of Point.

createMultiPoint

public static MultiPoint createMultiPoint(Point[] points,
                                          CoordinateSystem crs)
creates a MultiPoint from an array of Point.

Parameters:
points - array of Points
crs -
Returns:
a MultiPoint from an array of Point.

createMultiPoint

public static MultiPoint createMultiPoint(byte[] wkb,
                                          CoordinateSystem crs)
                                   throws GeometryException
creates a MultiPoint from a wkb.

Parameters:
wkb - byte stream that contains the wkb information
crs - CS_CoordinateSystem spatial reference system of the curve
Returns:
the MultiPoint defined by the WKB and the given CRS
Throws:
GeometryException - if the wkb is not known or invalid

createMultiCurve

public static MultiCurve createMultiCurve(Curve[] curves)
creates a MultiCurve from an array of Curves.

Parameters:
curves -
Returns:
a MultiCurve from an array of Curves.

createMultiCurve

public static MultiCurve createMultiCurve(Curve[] curves,
                                          CoordinateSystem crs)
creates a MultiCurve from an array of Curves.

Parameters:
curves -
crs -
Returns:
a MultiCurve from an array of Curves.

createMultiCurve

public static MultiCurve createMultiCurve(byte[] wkb,
                                          CoordinateSystem crs)
                                   throws GeometryException
creates a MultiCurve from a wkb.

Parameters:
wkb - byte stream that contains the wkb information
crs - CS_CoordinateSystem spatial reference system of the curve
Returns:
the MultiCurve defined by the WKB and the given CRS
Throws:
GeometryException - if the wkb is not known or invalid

createMultiSurface

public static MultiSurface createMultiSurface(Surface[] surfaces)
creates a MultiSurface from an array of surfaces

Parameters:
surfaces -
Returns:
a MultiSurface from an array of surfaces

createMultiSurface

public static MultiSurface createMultiSurface(Surface[] surfaces,
                                              CoordinateSystem crs)
creates a MultiSurface from an array of surfaces

Parameters:
surfaces -
crs -
Returns:
a MultiSurface from an array of surfaces

createMultiSurface

public static MultiSurface createMultiSurface(byte[] wkb,
                                              CoordinateSystem crs,
                                              SurfaceInterpolation si)
                                       throws GeometryException
creates a MultiSurface from a wkb

Parameters:
wkb - geometry in Well-Known Binary (WKB) format
crs - spatial reference system of the geometry
si - surface interpolation
Returns:
the MultiSurface defined by the WKB and the given CRS
Throws:
GeometryException - if the wkb is not known or invalid

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org