|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.geometry.jts.GeometryUtils
public final class GeometryUtils
Method Summary | |
---|---|
static void |
checkDimension(java.lang.String name,
org.opengis.referencing.crs.CoordinateReferenceSystem crs,
int expected)
Check if a reference coordinate system has the expected number of dimensions. |
static org.opengis.geometry.Envelope |
createCRSEnvelope(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
double minx,
double miny,
double maxx,
double maxy)
|
static org.opengis.geometry.primitive.Curve |
createCurve(org.opengis.geometry.DirectPosition[] points)
|
static org.opengis.geometry.Envelope |
createEnvelope(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
double minx,
double miny,
double maxx,
double maxy,
javax.measure.unit.Unit unit)
DOCUMENT ME. |
static org.opengis.geometry.coordinate.LineString |
createLineString(org.opengis.geometry.DirectPosition[] points)
|
static org.opengis.geometry.coordinate.Polygon |
createPolygon(org.opengis.geometry.DirectPosition[] exteriorRing)
|
static org.opengis.geometry.coordinate.Polygon |
createPolygon(org.opengis.geometry.DirectPosition[] exteriorRingPoints,
org.opengis.geometry.DirectPosition[][] interiorRingsPoints)
|
static org.opengis.geometry.coordinate.PolyhedralSurface |
createPolyhedralSurface(org.opengis.geometry.DirectPosition[][] patchPoints)
|
static org.opengis.geometry.primitive.Ring |
createRing(org.opengis.geometry.DirectPosition[] points)
|
static org.opengis.geometry.primitive.SurfaceBoundary |
createSurfaceBoundary(org.opengis.geometry.DirectPosition[] exteriorRingPoints,
org.opengis.geometry.DirectPosition[][] interiorRingsPoints)
|
static void |
ensureDimensionMatch(java.lang.String name,
int dimension,
int expectedDimension)
Convenience method for checking object dimension validity. |
static org.opengis.geometry.DirectPosition |
ensureWGS84(org.opengis.geometry.DirectPosition dp)
Verifies the CRS of the specified DirectPosition is
WGS84, and returns it unmodified if it is. |
static boolean |
equals(org.opengis.geometry.Envelope envelope1,
org.opengis.geometry.Envelope envelope2)
DOCUMENT ME. |
static double[] |
getBBox(org.opengis.geometry.Envelope envelope,
javax.measure.unit.Unit unit)
Converts an Envelope to a "minx, miny, maxx, maxy" array. |
static org.opengis.referencing.crs.CoordinateReferenceSystem |
getCRS(org.opengis.geometry.Envelope envelope)
|
static org.opengis.referencing.cs.CoordinateSystemAxis |
getDirectedAxis(org.opengis.referencing.cs.CoordinateSystem cs,
org.opengis.referencing.cs.AxisDirection direction)
Returns the CoordinateSystemAxis with the given AxisDirection . |
static int |
getDirectedAxisIndex(org.opengis.referencing.cs.CoordinateSystem cs,
org.opengis.referencing.cs.AxisDirection direction)
|
static javax.measure.unit.Unit |
getDirectedAxisUnit(org.opengis.referencing.cs.CoordinateSystem cs,
org.opengis.referencing.cs.AxisDirection direction)
|
static org.opengis.geometry.DirectPosition[] |
getDirectPositions(double[] points,
org.opengis.referencing.cs.AxisDirection[] sourceDirections,
javax.measure.unit.Unit[] sourceUnits,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Converts a double array to an array of DirectPosition s. |
static org.opengis.geometry.DirectPosition[] |
getDirectPositions(org.opengis.geometry.coordinate.LineString lineString)
|
static org.opengis.geometry.DirectPosition[] |
getDirectPositions(org.opengis.geometry.primitive.Ring ring)
|
static org.opengis.geometry.DirectPosition[] |
getExteriorDirectPositions(org.opengis.geometry.coordinate.Polygon polygon)
|
static org.opengis.geometry.DirectPosition[][] |
getInteriorDirectPositions(org.opengis.geometry.coordinate.Polygon polygon)
|
static org.opengis.geometry.coordinate.LineString[] |
getLineStrings(org.opengis.geometry.complex.CompositeCurve cc)
Returns an array of LineStrings corresponding to the primitive elements of the specified CompositeCurve. |
protected static org.apache.commons.logging.Log |
getLog()
Gets the log. |
static double[] |
getPoints(org.opengis.geometry.DirectPosition[] positions,
org.opengis.referencing.cs.AxisDirection[] targetDirections,
javax.measure.unit.Unit[] targetUnits)
Converts an array of DirectPosition s to a double array. |
static org.opengis.geometry.Envelope |
getWholeWorld()
|
static boolean |
intersects(org.opengis.geometry.Envelope envelope1,
org.opengis.geometry.Envelope envelope2)
Determines whether or not the two specified Envelopes intersect. |
static void |
populatePointArray(org.opengis.geometry.coordinate.PointArray pointArray,
org.opengis.geometry.DirectPosition[] dps)
Populates the specified PointArray with the specified points. |
static boolean |
within(org.opengis.geometry.Envelope envelope,
org.opengis.referencing.crs.CoordinateReferenceSystem crs,
double minx,
double miny,
double maxx,
double maxy)
DOCUMENT ME. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static org.opengis.geometry.Envelope getWholeWorld()
public static org.opengis.referencing.crs.CoordinateReferenceSystem getCRS(org.opengis.geometry.Envelope envelope)
public static double[] getBBox(org.opengis.geometry.Envelope envelope, javax.measure.unit.Unit unit)
Envelope
to a "minx, miny, maxx, maxy" array.
envelope
- unit
-
public static org.opengis.geometry.Envelope createCRSEnvelope(org.opengis.referencing.crs.CoordinateReferenceSystem crs, double minx, double miny, double maxx, double maxy)
public static org.opengis.geometry.Envelope createEnvelope(org.opengis.referencing.crs.CoordinateReferenceSystem crs, double minx, double miny, double maxx, double maxy, javax.measure.unit.Unit unit)
crs
- minx
- miny
- maxx
- maxy
- unit
-
public static boolean within(org.opengis.geometry.Envelope envelope, org.opengis.referencing.crs.CoordinateReferenceSystem crs, double minx, double miny, double maxx, double maxy)
envelope
- crs
- minx
- miny
- maxx
- maxy
-
public static boolean equals(org.opengis.geometry.Envelope envelope1, org.opengis.geometry.Envelope envelope2)
envelope1
- envelope2
-
public static boolean intersects(org.opengis.geometry.Envelope envelope1, org.opengis.geometry.Envelope envelope2)
envelope1
- envelope2
-
public static org.opengis.geometry.DirectPosition[] getDirectPositions(double[] points, org.opengis.referencing.cs.AxisDirection[] sourceDirections, javax.measure.unit.Unit[] sourceUnits, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
DirectPosition
s.
points
- the source datasourceDirections
- the source data's axes' directionssourceUnits
- the source data's axes' unitscrs
- the target CoordinateReferenceSystem
. the crs
's
dimension must match the 'dimension' in the source double array.
public static double[] getPoints(org.opengis.geometry.DirectPosition[] positions, org.opengis.referencing.cs.AxisDirection[] targetDirections, javax.measure.unit.Unit[] targetUnits)
DirectPosition
s to a double array.
positions
- the source datatargetDirections
- the target data's axes' directionstargetUnits
- the target data's axes' units
public static org.opengis.geometry.DirectPosition ensureWGS84(org.opengis.geometry.DirectPosition dp)
DirectPosition
is
WGS84, and returns it unmodified if it is.
If not, transforms the input into a new DirectPosition
with a WGS84 CRS. Returns it as a LatLonAlt if input was LatLonAlt.
dp
- The DirectPosition to examine and transform if necessary
public static void populatePointArray(org.opengis.geometry.coordinate.PointArray pointArray, org.opengis.geometry.DirectPosition[] dps)
pointArray
- The PointArray to be populated. This must not be null.dps
- The new array of pointspublic static org.opengis.geometry.coordinate.LineString[] getLineStrings(org.opengis.geometry.complex.CompositeCurve cc)
cc
- The CompositeCurve of interest
java.lang.IllegalArgumentException
- if any element cannot be converted.
For the present version, only Curves that wrap only LineStrings are convertible.public static org.opengis.geometry.DirectPosition[] getDirectPositions(org.opengis.geometry.coordinate.LineString lineString)
public static org.opengis.geometry.DirectPosition[] getDirectPositions(org.opengis.geometry.primitive.Ring ring)
public static org.opengis.geometry.DirectPosition[] getExteriorDirectPositions(org.opengis.geometry.coordinate.Polygon polygon)
public static org.opengis.geometry.DirectPosition[][] getInteriorDirectPositions(org.opengis.geometry.coordinate.Polygon polygon)
public static org.opengis.geometry.coordinate.PolyhedralSurface createPolyhedralSurface(org.opengis.geometry.DirectPosition[][] patchPoints)
public static org.opengis.geometry.coordinate.Polygon createPolygon(org.opengis.geometry.DirectPosition[] exteriorRing)
public static org.opengis.geometry.coordinate.Polygon createPolygon(org.opengis.geometry.DirectPosition[] exteriorRingPoints, org.opengis.geometry.DirectPosition[][] interiorRingsPoints)
public static org.opengis.geometry.primitive.SurfaceBoundary createSurfaceBoundary(org.opengis.geometry.DirectPosition[] exteriorRingPoints, org.opengis.geometry.DirectPosition[][] interiorRingsPoints)
public static org.opengis.geometry.primitive.Ring createRing(org.opengis.geometry.DirectPosition[] points)
public static org.opengis.geometry.primitive.Curve createCurve(org.opengis.geometry.DirectPosition[] points)
public static org.opengis.geometry.coordinate.LineString createLineString(org.opengis.geometry.DirectPosition[] points)
protected static org.apache.commons.logging.Log getLog()
public static void checkDimension(java.lang.String name, org.opengis.referencing.crs.CoordinateReferenceSystem crs, int expected)
name
- The argument name.crs
- The coordinate reference system to check.expected
- The expected number of dimensions.public static void ensureDimensionMatch(java.lang.String name, int dimension, int expectedDimension) throws org.opengis.geometry.MismatchedDimensionException
name
- The name of the argument to check.dimension
- The object dimension.expectedDimension
- The Expected dimension for the object.
org.opengis.geometry.MismatchedDimensionException
- if the object doesn't have the expected dimension.public static org.opengis.referencing.cs.CoordinateSystemAxis getDirectedAxis(org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.cs.AxisDirection direction)
CoordinateSystemAxis
with the given AxisDirection
.
cs
- the CoordinateSystem
to checkdirection
- the AxisDirection
to check for
public static int getDirectedAxisIndex(org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.cs.AxisDirection direction)
public static javax.measure.unit.Unit getDirectedAxisUnit(org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.cs.AxisDirection direction)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |