|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.spatial.geom.GeometryFactory
public class GeometryFactory
This class contains methods to create geometry objects.
Method Summary | |
---|---|
Geometry |
createEmptyGeometry(java.lang.String type,
boolean is3D,
boolean isMeasured)
Returns an empty Geometry of type specified by the string type, with characteristics specified by is3D and isMeasured. |
Geometry |
createGeometry(java.lang.String type,
double[] xy,
double[] z,
double[] m,
int[] partOffsets,
int[] subPartOffsets)
Returns a Geometry of type specified by the string type, with coordinates specified by arrays xy (xy coordinate pairs), z (z coordinates - optional), m (m values - optional). |
Geometry |
createGeometryCollection(java.lang.String type,
Geometry[] geometries)
Returns a GeometryCollection descendent of type specified by the string type, from the specified array of geometries. |
Point |
createPoint(CoordPoint point)
Returns a Point located at the coordinates specified by point. |
Point |
createPoint(double x,
double y)
Returns a Point located at the coordinates specified by x and y. |
Point |
createPoint(double x,
double y,
double z,
double m)
Returns a Point located at the coordinates specified by point. |
Polygon |
createPolygon(Envelope envelope)
Returns a Polygon with an exterior ring specified by the envelope passed as argument. |
static GeometryFactory |
getInstance(CoordRef cr)
Returns a GeometryFactory object that can create geometries in the coordinate reference specified by srs. |
static GeometryFactory |
getInstance(java.lang.String family,
CoordRef cr)
|
CoordRef |
getSpatialReference()
Returns the spatial reference system of this GeometryFactory. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static GeometryFactory getInstance(java.lang.String family, CoordRef cr)
public static GeometryFactory getInstance(CoordRef cr)
cr
- The coordinate reference in which the geometries will
be created.
public CoordRef getSpatialReference()
public Point createPoint(CoordPoint point) throws SpatialException
point
- A CoordPoint object specifying the coordinates of
the returned Point. If point holds integer values, they are
assumed to be system values relative to the coordinate
reference of this factory, and are converted to world
values before creating the Point geometry.
If the point argument falls outside the region specified by
the coordinate reference associated with this factory,
an error is reported to the SpatialManager.
SpatialException
public Point createPoint(double x, double y) throws SpatialException
x
- the x ordinatey
- the y ordinate
SpatialException
public Point createPoint(double x, double y, double z, double m) throws SpatialException
x
- the x ordinatey
- the y ordinatez
- the z ordinate (optional). If this value is Double.NaN, the
geometry returned will not have a z coordinatem
- the m ordinate (optional). If this value is Double.NaN, the
geometry returned will not have a measure.
SpatialException
public Polygon createPolygon(Envelope envelope)
If the argument has z or m coordinates, then the returning polygon will have z or m coordinates, with values interpolated between the limits specified by the envelope.
envelope
- an Envelope specifying the exterior ring
of the polygon
public Geometry createEmptyGeometry(java.lang.String type, boolean is3D, boolean isMeasured) throws java.lang.ClassNotFoundException
type
- the type of the geometry to be createdis3D
- true if the geometry has Z coordinatesisMeasured
- true if the geometry has M values
java.lang.ClassNotFoundException
- if type is not the name of
an instantiable geometry class from the package
com.ibm.spatial.geom.public Geometry createGeometry(java.lang.String type, double[] xy, double[] z, double[] m, int[] partOffsets, int[] subPartOffsets) throws java.lang.ClassNotFoundException, SpatialException
In order to create an empty geometry, xy must be null or a zero length array. In this case, the geometry has a "z" subtype iff z is not null, and has a "m" subtype iff m is not null.
Note: when creating a Polygon, you have to make sure that the exterior ring is located first in the coordinate arrays.
type
- the type of the geometry to be createdxy
- array of xy coordinate pairs; if null or of length equal
to zero, an empty geometry will be createdz
- array of z coordinate pairs; if null, the geometry
created will not have z coordinatesm
- array of m values; if null, the geometry
created will not have measure valuespartOffsets
- array holding positions in the xy coordinate array
where geometry parts start. This argument is required for
MultiLineString, Polygon, and MultiPolygon geometries.subPartOffsets
- array holding positions in the xy coordinate
array where geometry subparts start. This argument is
required for Polygon and MultiPolygon geometries.
java.lang.ClassNotFoundException
- if type is not the name of
an instantiable geometry class from the package
com.ibm.spatial.geom.
SpatialException
- in case of invalid coordinate/offset datapublic Geometry createGeometryCollection(java.lang.String type, Geometry[] geometries) throws java.lang.ClassNotFoundException, SpatialException
Descendents of GeometryCollection may impose additional restrictions on the geometry array, for example the elements must have the same type. If any of the restrictions are not satisfied, an error is reported to the SpatialManager.
type
- the type of the geometry to be createdgeometries
- array of geometry objects; if null or empty, an empty
geometry of the specified type will be created.
java.lang.ClassNotFoundException
- if type is not the name of
a geometry interface from the package com.ibm.spatial.geom.
SpatialException
- in case the geometry objects specified by
geometries can't be members of the geometry collection
object of type specified by type
|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |