public class JTSHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.locationtech.jts.geom.CoordinateFilter |
COORDINATE_SWITCHING_FILTER |
static String |
WKT_POINT |
static String |
WKT_POLYGON |
| Modifier | Constructor and Description |
|---|---|
protected |
JTSHelper() |
| Modifier and Type | Method and Description |
|---|---|
static org.locationtech.jts.geom.Envelope |
createEnvelopeFromLowerUpperCorner(String lowerCorner,
String upperCorner) |
static org.locationtech.jts.geom.Geometry |
createGeometryFromWKT(String wkt,
int srid)
Creates a JTS Geometry from an WKT representation.
|
static org.locationtech.jts.geom.Geometry |
createPolygonFromEnvelope(double[] envelope,
int srid) |
static org.locationtech.jts.geom.Geometry |
createPolygonFromEnvelope(double minx,
double miny,
double maxx,
double maxy,
int srid) |
static String |
createWKTPointFromCoordinateString(String coordinates)
Creates a WKT Point string form coordinate string.
|
static String |
createWKTPolygonFromEnvelope(String lowerCorner,
String upperCorner)
Creates a WKT Polygon representation from lower and upper corner values.
|
static String |
getCoordinatesString(org.locationtech.jts.geom.Coordinate[] sourceCoords) |
static String |
getCoordinatesString(org.locationtech.jts.geom.Geometry geom)
Get the coordinates of a Geometry as String.
|
protected static StringBuilder |
getCoordinateString(StringBuilder builder,
org.locationtech.jts.geom.Coordinate coordinate) |
static org.locationtech.jts.geom.Coordinate[] |
getExteriorRingCoordinatesFromPolygon(org.locationtech.jts.geom.Polygon polygon)
Fix for Binary-Incompatible-Change in JTS 1.17.0 Polygon getExteriorRing() which
returns LinearRing instead of a LineString.
|
static org.locationtech.jts.geom.GeometryFactory |
getGeometryFactory(org.locationtech.jts.geom.Geometry geometry) |
static org.locationtech.jts.geom.GeometryFactory |
getGeometryFactoryForSRID(int srid) |
static org.n52.shetland.util.JTSHelper.SwitchCoordinateGeometryFactory |
getSwitchCoordinateGeometryFactoryForSRID(int srid) |
static org.locationtech.jts.io.WKTReader |
getWKTReaderForSRID(int srid) |
static boolean |
isNotEmpty(org.locationtech.jts.geom.Geometry geometry) |
static <G extends org.locationtech.jts.geom.Geometry> |
switchCoordinateAxisOrder(G geometry)
Switches the coordinates of a JTS Geometry.
|
public static final String WKT_POLYGON
public static final String WKT_POINT
public static final org.locationtech.jts.geom.CoordinateFilter COORDINATE_SWITCHING_FILTER
public static org.locationtech.jts.geom.Geometry createGeometryFromWKT(String wkt, int srid) throws org.locationtech.jts.io.ParseException
wkt - WKT representation of the geometrysrid - the SRID of the newly created geometryorg.locationtech.jts.io.ParseException - If an error occurspublic static org.locationtech.jts.io.WKTReader getWKTReaderForSRID(int srid)
public static String getCoordinatesString(org.locationtech.jts.geom.Geometry geom)
geom - Geometry to get coordinatespublic static String getCoordinatesString(org.locationtech.jts.geom.Coordinate[] sourceCoords)
protected static StringBuilder getCoordinateString(StringBuilder builder, org.locationtech.jts.geom.Coordinate coordinate)
public static String createWKTPolygonFromEnvelope(String lowerCorner, String upperCorner)
lowerCorner - Lower corner coordinatesupperCorner - Upper corner coordinatespublic static org.locationtech.jts.geom.Envelope createEnvelopeFromLowerUpperCorner(String lowerCorner, String upperCorner)
public static org.locationtech.jts.geom.Geometry createPolygonFromEnvelope(double[] envelope,
int srid)
public static org.locationtech.jts.geom.Geometry createPolygonFromEnvelope(double minx,
double miny,
double maxx,
double maxy,
int srid)
public static <G extends org.locationtech.jts.geom.Geometry> G switchCoordinateAxisOrder(G geometry)
G - the geometry typegeometry - Geometry to switch coordinates.public static org.locationtech.jts.geom.GeometryFactory getGeometryFactory(org.locationtech.jts.geom.Geometry geometry)
public static org.locationtech.jts.geom.GeometryFactory getGeometryFactoryForSRID(int srid)
public static org.n52.shetland.util.JTSHelper.SwitchCoordinateGeometryFactory getSwitchCoordinateGeometryFactoryForSRID(int srid)
public static String createWKTPointFromCoordinateString(String coordinates)
coordinates - Coordinate stringpublic static boolean isNotEmpty(org.locationtech.jts.geom.Geometry geometry)
public static org.locationtech.jts.geom.Coordinate[] getExteriorRingCoordinatesFromPolygon(org.locationtech.jts.geom.Polygon polygon)
polygon - polygon to get exterior ring fromCopyright © 2015–2021 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.