public class GeometryUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GeometryUtils.GeoConstraintsWrapper |
static interface |
GeometryUtils.GeometryHandler |
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CRS_STR |
static org.locationtech.jts.geom.GeometryFactory |
GEOMETRY_FACTORY |
static Integer |
MAX_GEOMETRY_PRECISION |
static org.locationtech.jts.geom.prep.PreparedGeometryFactory |
PREPARED_GEOMETRY_FACTORY |
| Constructor and Description |
|---|
GeometryUtils() |
| Modifier and Type | Method and Description |
|---|---|
static double |
adjustCoordinateDimensionToRange(double val,
org.opengis.referencing.crs.CoordinateReferenceSystem crs,
int axis)
This is perhaps a brain dead approach to do this, but it does handle wrap around cases.
|
static org.locationtech.jts.geom.Coordinate |
adjustCoordinateToFitInRange(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
org.locationtech.jts.geom.Coordinate coord)
Make sure the coordinate falls in the range of provided coordinate reference systems's
coordinate system.
|
static org.locationtech.jts.geom.Geometry |
adjustGeo(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
org.locationtech.jts.geom.Geometry geometry)
Consume a geometry that may be over the ranges of the CRS (e.g date-line crossing).
|
static BasicQueryByClass.ConstraintSet |
basicConstraintSetFromEnvelope(org.locationtech.jts.geom.Envelope env)
This utility method will convert a JTS envelope to contraints that can be used in a GeoWave
query.
|
static Constraints |
basicConstraintsFromEnvelope(org.locationtech.jts.geom.Envelope env)
This utility method will convert a JTS envelope to contraints that can be used in a GeoWave
query.
|
static BasicQueryByClass.ConstraintsByClass |
basicConstraintsFromGeometry(org.locationtech.jts.geom.Geometry geometry) |
static BasicQueryByClass.ConstraintSet |
basicConstraintsFromPoint(double latitudeDegrees,
double longitudeDegrees)
This utility method will convert a JTS envelope to that can be used in a GeoWave query.
|
static GeometryUtils.GeoConstraintsWrapper |
basicGeoConstraintsWrapperFromGeometry(org.locationtech.jts.geom.Geometry geometry)
This utility method will convert a JTS geometry to contraints that can be used in a GeoWave
query.
|
static org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Geometry,Double> |
buffer(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
org.locationtech.jts.geom.Geometry geometry,
String distanceUnits,
double distance)
Build a buffer around a geometry
|
static List<org.locationtech.jts.geom.Polygon> |
constructGeometriesOverMapRegions(org.locationtech.jts.geom.Coordinate modifier,
org.locationtech.jts.geom.Geometry geometry)
Produce a set of polygons for each region of the map corrected for date line and hemisphere
crossings.
|
static boolean |
crsMatches(String crsCode1,
String crsCode2) |
static org.locationtech.jts.geom.Geometry |
crsTransform(org.locationtech.jts.geom.Geometry geometry,
org.opengis.referencing.operation.MathTransform transform) |
static org.opengis.feature.simple.SimpleFeature |
crsTransform(org.opengis.feature.simple.SimpleFeature entry,
org.opengis.feature.simple.SimpleFeatureType reprojectedType,
org.opengis.referencing.operation.MathTransform transform) |
static org.opengis.referencing.crs.CoordinateReferenceSystem |
decodeCRS(String crsCode) |
static List<org.locationtech.jts.geom.Polygon> |
fixRangeOfCoordinates(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
org.locationtech.jts.geom.Geometry geometry)
Adjust geometry so that coordinates fit into long/lat bounds.
|
static org.locationtech.jts.geom.Geometry |
geometryFromBinary(byte[] binary,
Integer precision)
Converts a byte array as well-known binary to a JTS geometry
|
static org.locationtech.jts.geom.Geometry |
geometryFromBinary(byte[] binary,
Integer precision,
byte serializationVersion)
Converts a byte array as well-known binary to a JTS geometry
|
static byte[] |
geometryToBinary(org.locationtech.jts.geom.Geometry geometry,
Integer precision)
Converts a JTS geometry to binary using JTS a Well Known Binary writer
|
static org.opengis.filter.spatial.SpatialOperator |
geometryToSpatialOperator(org.locationtech.jts.geom.Geometry jtsGeom,
String geometryAttributeName,
org.opengis.referencing.crs.CoordinateReferenceSystem crs) |
static MultiDimensionalNumericData |
getBoundsFromEnvelope(org.locationtech.jts.geom.Envelope envelope) |
static String |
getCrsCode(org.opengis.referencing.crs.CoordinateReferenceSystem crs) |
static org.opengis.referencing.crs.CoordinateReferenceSystem |
getDefaultCRS() |
static org.opengis.referencing.crs.CoordinateReferenceSystem |
getIndexCrs(Index index) |
static org.opengis.referencing.crs.CoordinateReferenceSystem |
getIndexCrs(Index[] indices) |
static org.locationtech.jts.geom.Geometry |
infinity()
This mehtod returns an envelope between negative infinite and positive inifinity in both x and
y
|
static void |
initClassLoader() |
static boolean |
isDefaultCrs(org.opengis.referencing.crs.CoordinateReferenceSystem crs) |
static boolean |
isDefaultCrs(String crsCode) |
static javax.measure.Unit<javax.measure.quantity.Length> |
lookup(String name) |
static void |
visitGeometry(org.locationtech.jts.geom.Geometry geom,
GeometryUtils.GeometryHandler geometryHandler) |
static org.locationtech.jts.geom.Geometry |
world(org.locationtech.jts.geom.GeometryFactory factory,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Return a multi-polygon representing the bounded map regions split by the axis
|
static NumericData |
xRangeFromGeometry(org.locationtech.jts.geom.Geometry geometry)
Generate a longitude range from a JTS geometry
|
static NumericData |
yRangeFromGeometry(org.locationtech.jts.geom.Geometry geometry)
Generate a latitude range from a JTS geometry
|
public static final org.locationtech.jts.geom.GeometryFactory GEOMETRY_FACTORY
public static final org.locationtech.jts.geom.prep.PreparedGeometryFactory PREPARED_GEOMETRY_FACTORY
public static final String DEFAULT_CRS_STR
public static final Integer MAX_GEOMETRY_PRECISION
public static org.opengis.filter.spatial.SpatialOperator geometryToSpatialOperator(org.locationtech.jts.geom.Geometry jtsGeom,
String geometryAttributeName,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
public static void visitGeometry(org.locationtech.jts.geom.Geometry geom,
GeometryUtils.GeometryHandler geometryHandler)
public static org.opengis.referencing.crs.CoordinateReferenceSystem decodeCRS(String crsCode)
public static org.opengis.referencing.crs.CoordinateReferenceSystem getDefaultCRS()
public static boolean isDefaultCrs(String crsCode)
public static boolean isDefaultCrs(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
public static void initClassLoader()
public static BasicQueryByClass.ConstraintsByClass basicConstraintsFromGeometry(org.locationtech.jts.geom.Geometry geometry)
public static GeometryUtils.GeoConstraintsWrapper basicGeoConstraintsWrapperFromGeometry(org.locationtech.jts.geom.Geometry geometry)
public static BasicQueryByClass.ConstraintSet basicConstraintSetFromEnvelope(org.locationtech.jts.geom.Envelope env)
public static Constraints basicConstraintsFromEnvelope(org.locationtech.jts.geom.Envelope env)
public static BasicQueryByClass.ConstraintSet basicConstraintsFromPoint(double latitudeDegrees, double longitudeDegrees)
public static MultiDimensionalNumericData getBoundsFromEnvelope(org.locationtech.jts.geom.Envelope envelope)
public static NumericData xRangeFromGeometry(org.locationtech.jts.geom.Geometry geometry)
geometry - The JTS geometrypublic static NumericData yRangeFromGeometry(org.locationtech.jts.geom.Geometry geometry)
geometry - The JTS geometrypublic static byte[] geometryToBinary(org.locationtech.jts.geom.Geometry geometry,
@Nullable
Integer precision)
geometry - The JTS geometrypublic static org.locationtech.jts.geom.Geometry geometryFromBinary(byte[] binary,
@Nullable
Integer precision)
binary - The well known binarypublic static org.locationtech.jts.geom.Geometry geometryFromBinary(byte[] binary,
@Nullable
Integer precision,
byte serializationVersion)
binary - The well known binarypublic static org.locationtech.jts.geom.Geometry infinity()
public static org.opengis.referencing.crs.CoordinateReferenceSystem getIndexCrs(Index[] indices)
public static org.opengis.referencing.crs.CoordinateReferenceSystem getIndexCrs(Index index)
public static String getCrsCode(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
public static final org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Geometry,Double> buffer(org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.locationtech.jts.geom.Geometry geometry, String distanceUnits, double distance) throws org.opengis.referencing.operation.TransformException
crs - geometry - distanceUnits - distance - org.opengis.referencing.operation.TransformExceptionpublic static javax.measure.Unit<javax.measure.quantity.Length> lookup(String name)
public static org.locationtech.jts.geom.Geometry adjustGeo(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
org.locationtech.jts.geom.Geometry geometry)
crs - geometry - public static List<org.locationtech.jts.geom.Polygon> fixRangeOfCoordinates(org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.locationtech.jts.geom.Geometry geometry)
Split date-line crossing polygons.
For now, clip hemisphere crossing portions of the polygon.
geometry - public static List<org.locationtech.jts.geom.Polygon> constructGeometriesOverMapRegions(org.locationtech.jts.geom.Coordinate modifier, org.locationtech.jts.geom.Geometry geometry)
Consider a polygon that cross both the hemisphere in the north and the date line in the west (-182 92, -182 88, -178 88, -178 92, -182 92). The result is two polygons: (-180 90, -180 88, -178 88, -178 90, -180 90) (180 90, 180 88, 178 88, 178 90, 180 90)
modifier - geometry - - a geometry that may cross date line and/or hemispheres.public static org.locationtech.jts.geom.Coordinate adjustCoordinateToFitInRange(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
org.locationtech.jts.geom.Coordinate coord)
crs - coord - public static double adjustCoordinateDimensionToRange(double val,
org.opengis.referencing.crs.CoordinateReferenceSystem crs,
int axis)
val - the valuecrs - axis - the coordinate axispublic static org.locationtech.jts.geom.Geometry world(org.locationtech.jts.geom.GeometryFactory factory,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
factory - crs - public static org.opengis.feature.simple.SimpleFeature crsTransform(org.opengis.feature.simple.SimpleFeature entry,
org.opengis.feature.simple.SimpleFeatureType reprojectedType,
org.opengis.referencing.operation.MathTransform transform)
public static org.locationtech.jts.geom.Geometry crsTransform(org.locationtech.jts.geom.Geometry geometry,
org.opengis.referencing.operation.MathTransform transform)
Copyright © 2013–2021. All rights reserved.