|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.geom.GeometryFactory
Supplies a set of utility methods for building Geometry objects from lists of Coordinates.
Constructor Summary | |
GeometryFactory()
Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0. |
|
GeometryFactory(CoordinateSequenceFactory coordinateSequenceFactory)
Constructs a GeometryFactory that generates Geometries having the given CoordinateSequence implementation, a double-precision floating PrecisionModel and a spatial-reference ID of 0. |
|
GeometryFactory(PrecisionModel precisionModel)
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and the default CoordinateSequence
implementation. |
|
GeometryFactory(PrecisionModel precisionModel,
int SRID)
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and spatial-reference ID, and the default CoordinateSequence
implementation. |
|
GeometryFactory(PrecisionModel precisionModel,
int SRID,
CoordinateSequenceFactory coordinateSequenceFactory)
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. |
Method Summary | |
Geometry |
buildGeometry(java.util.Collection geomList)
Build an appropriate Geometry , MultiGeometry , or
GeometryCollection to contain the Geometry s in
it. |
Geometry |
createGeometry(Geometry g)
|
GeometryCollection |
createGeometryCollection(Geometry[] geometries)
Creates a GeometryCollection using the given Geometries; a null or empty array will create an empty GeometryCollection. |
LinearRing |
createLinearRing(Coordinate[] coordinates)
Creates a LinearRing using the given Coordinates; a null or empty array will create an empty LinearRing. |
LinearRing |
createLinearRing(CoordinateSequence coordinates)
Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence will create an empty LinearRing. |
LineString |
createLineString(Coordinate[] coordinates)
Creates a LineString using the given Coordinates; a null or empty array will create an empty LineString. |
LineString |
createLineString(CoordinateSequence coordinates)
Creates a LineString using the given CoordinateSequence; a null or empty CoordinateSequence will create an empty LineString. |
MultiLineString |
createMultiLineString(LineString[] lineStrings)
Creates a MultiLineString using the given LineStrings; a null or empty array will create an empty MultiLineString. |
MultiPoint |
createMultiPoint(Coordinate[] coordinates)
Creates a MultiPoint using the given Coordinates; a null or empty array will create an empty MultiPoint. |
MultiPoint |
createMultiPoint(CoordinateSequence coordinates)
Creates a MultiPoint using the given CoordinateSequence; a null or empty CoordinateSequence will create an empty MultiPoint. |
MultiPoint |
createMultiPoint(Point[] point)
Creates a MultiPoint using the given Points; a null or empty array will create an empty MultiPoint. |
MultiPolygon |
createMultiPolygon(Polygon[] polygons)
Creates a MultiPolygon using the given Polygons; a null or empty array will create an empty Polygon. |
Point |
createPoint(Coordinate coordinate)
Creates a Point using the given Coordinate; a null Coordinate will create an empty Geometry. |
Point |
createPoint(CoordinateSequence coordinates)
Creates a Point using the given CoordinateSequence; a null or empty CoordinateSequence will create an empty Point. |
static Point |
createPointFromInternalCoord(Coordinate coord,
Geometry exemplar)
|
Polygon |
createPolygon(LinearRing shell,
LinearRing[] holes)
Constructs a Polygon with the given exterior boundary and
interior boundaries. |
CoordinateSequenceFactory |
getCoordinateSequenceFactory()
|
PrecisionModel |
getPrecisionModel()
Returns the PrecisionModel that Geometries created by this factory will be associated with. |
int |
getSRID()
|
Geometry |
toGeometry(Envelope envelope)
If the Envelope is a null Envelope , returns an
empty Point . |
static Geometry[] |
toGeometryArray(java.util.Collection geometries)
Converts the List to an array. |
static LinearRing[] |
toLinearRingArray(java.util.Collection linearRings)
Converts the List to an array. |
static LineString[] |
toLineStringArray(java.util.Collection lineStrings)
Converts the List to an array. |
static MultiLineString[] |
toMultiLineStringArray(java.util.Collection multiLineStrings)
Converts the List to an array. |
static MultiPoint[] |
toMultiPointArray(java.util.Collection multiPoints)
Converts the List to an array. |
static MultiPolygon[] |
toMultiPolygonArray(java.util.Collection multiPolygons)
Converts the List to an array. |
static Point[] |
toPointArray(java.util.Collection points)
Converts the List to an array. |
static Polygon[] |
toPolygonArray(java.util.Collection polygons)
Converts the List to an array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GeometryFactory(PrecisionModel precisionModel, int SRID, CoordinateSequenceFactory coordinateSequenceFactory)
public GeometryFactory(CoordinateSequenceFactory coordinateSequenceFactory)
public GeometryFactory(PrecisionModel precisionModel)
PrecisionModel
and the default CoordinateSequence
implementation.
precisionModel
- the PrecisionModel to usepublic GeometryFactory(PrecisionModel precisionModel, int SRID)
PrecisionModel
and spatial-reference ID, and the default CoordinateSequence
implementation.
precisionModel
- the PrecisionModel to useSRID
- the SRID to usepublic GeometryFactory()
Method Detail |
public static Point createPointFromInternalCoord(Coordinate coord, Geometry exemplar)
public static Point[] toPointArray(java.util.Collection points)
List
to an array.
points
- the List
of Points to convert
List
in array formatpublic static Geometry[] toGeometryArray(java.util.Collection geometries)
List
to an array.
geometries
- the list of Geometry's
to convert
List
in array formatpublic static LinearRing[] toLinearRingArray(java.util.Collection linearRings)
List
to an array.
linearRings
- the List
of LinearRings to convert
List
in array formatpublic static LineString[] toLineStringArray(java.util.Collection lineStrings)
List
to an array.
lineStrings
- the List
of LineStrings to convert
List
in array formatpublic static Polygon[] toPolygonArray(java.util.Collection polygons)
List
to an array.
polygons
- the List
of Polygons to convert
List
in array formatpublic static MultiPolygon[] toMultiPolygonArray(java.util.Collection multiPolygons)
List
to an array.
multiPolygons
- the List
of MultiPolygons to convert
List
in array formatpublic static MultiLineString[] toMultiLineStringArray(java.util.Collection multiLineStrings)
List
to an array.
multiLineStrings
- the List
of MultiLineStrings to convert
List
in array formatpublic static MultiPoint[] toMultiPointArray(java.util.Collection multiPoints)
List
to an array.
multiPoints
- the List
of MultiPoints to convert
List
in array formatpublic Geometry toGeometry(Envelope envelope)
Envelope
is a null Envelope
, returns an
empty Point
. If the Envelope
is a point, returns
a non-empty Point
. If the Envelope
is a
rectangle, returns a Polygon
whose points are (minx, miny),
(maxx, miny), (maxx, maxy), (minx, maxy), (minx, miny).
envelope
- the Envelope
to convert to a Geometry
Point
(for null Envelope
s), a Point
(when min x = max x and min y = max y) or a
Polygon
(in all other cases)
- TopologyException
if coordinates
is not a closed linestring, that is, if the first and last coordinates
are not equalpublic PrecisionModel getPrecisionModel()
public Point createPoint(Coordinate coordinate)
public Point createPoint(CoordinateSequence coordinates)
public MultiLineString createMultiLineString(LineString[] lineStrings)
lineStrings
- LineStrings, each of which may be empty but not nullpublic GeometryCollection createGeometryCollection(Geometry[] geometries)
geometries
- Geometries, each of which may be empty but not nullpublic MultiPolygon createMultiPolygon(Polygon[] polygons)
polygons
- Polygons, each of which may be empty but not nullpublic LinearRing createLinearRing(Coordinate[] coordinates)
coordinates
- an array without null elements, or an empty array, or nullpublic LinearRing createLinearRing(CoordinateSequence coordinates)
coordinates
- a CoordinateSequence possibly empty, or nullpublic MultiPoint createMultiPoint(Point[] point)
public MultiPoint createMultiPoint(Coordinate[] coordinates)
coordinates
- an array without null elements, or an empty array, or nullpublic MultiPoint createMultiPoint(CoordinateSequence coordinates)
coordinates
- a CoordinateSequence possibly empty, or nullpublic Polygon createPolygon(LinearRing shell, LinearRing[] holes)
Polygon
with the given exterior boundary and
interior boundaries.
shell
- the outer boundary of the new Polygon
, or
null
or an empty LinearRing
if
the empty geometry is to be created.holes
- the inner boundaries of the new Polygon
, or
null
or empty LinearRing
s if
the empty geometry is to be created.public Geometry buildGeometry(java.util.Collection geomList)
Geometry
, MultiGeometry
, or
GeometryCollection
to contain the Geometry
s in
it.
For example:geomList
contains a single Polygon
,
the Polygon
is returned.
geomList
contains several Polygon
s, a
MultiPolygon
is returned.
geomList
contains some Polygon
s and
some LineString
s, a GeometryCollection
is
returned.
geomList
is empty, an empty GeometryCollection
is returned
geomList
- the Geometry
s to combine
Geometry
of the "smallest", "most
type-specific" class that can contain the elements of geomList
.public LineString createLineString(Coordinate[] coordinates)
coordinates
- an array without null elements, or an empty array, or nullpublic LineString createLineString(CoordinateSequence coordinates)
coordinates
- a CoordinateSequence possibly empty, or nullpublic Geometry createGeometry(Geometry g)
public int getSRID()
public CoordinateSequenceFactory getCoordinateSequenceFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |