Package org.geolatte.geom.jts
Class JTS
- java.lang.Object
-
- org.geolatte.geom.jts.JTS
-
public class JTS extends Object
- Author:
- Karel Maesen, Geovise BVBA, 2011 (original code), Yves Vandewoude, Qmino bvba, 2011 (bugfixes)
-
-
Constructor Summary
Constructors Constructor Description JTS()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Envelope<C2D>from(org.locationtech.jts.geom.Envelope jtsEnvelope)Converts a JTSEnvelopeto a geolatteEnvelope.static <P extends Position>
Envelope<P>from(org.locationtech.jts.geom.Envelope jtsEnvelope, CoordinateReferenceSystem<P> crs)Converts a JTSEnvelopeto a geolatteEnvelopewith the specified CRS.static Geometry<?>from(org.locationtech.jts.geom.Geometry jtsGeometry)Primary Factory method that converts a JTS geometry into an equivalent geolatte geometrystatic <P extends Position>
Geometry<P>from(org.locationtech.jts.geom.Geometry jtsGeometry, CoordinateReferenceSystem<P> crs)Factory method that converts a JTS geometry into an equivalent geolatte geometry and allows the caller to specify the CoordinateReferenceSystem of the resulting geolatte geometry.static Class<? extends org.locationtech.jts.geom.Geometry>getCorrespondingJTSClass(Class<? extends Geometry> geometryClass)Returns the JTS Geometry class that corresponds to the specified Geolatte Geometry class.static org.locationtech.jts.geom.Envelopeto(Envelope<?> env)Converts a GeolatteEnvelopeto a JTSEnvelope.static <P extends Position>
org.locationtech.jts.geom.Geometryto(Geometry<P> geometry)static <P extends Position>
org.locationtech.jts.geom.Geometryto(Geometry<P> geometry, org.locationtech.jts.geom.GeometryFactory gFact)Primary factory method that converts a geolatte geometry into an equivalent jts geometry
-
-
-
Method Detail
-
getCorrespondingJTSClass
public static Class<? extends org.locationtech.jts.geom.Geometry> getCorrespondingJTSClass(Class<? extends Geometry> geometryClass)
Returns the JTS Geometry class that corresponds to the specified Geolatte Geometry class.Geometry classes correspond iff they are of the same Geometry type in the SFS or SFA geometry model.
- Parameters:
geometryClass- the JTS Geometry class- Returns:
- the corresponding o.g.geom class
- Throws:
IllegalArgumentException- when the geometryClass parameter is null.NoSuchElementException- when no corresponding class can be found.
-
from
public static Geometry<?> from(org.locationtech.jts.geom.Geometry jtsGeometry)
Primary Factory method that converts a JTS geometry into an equivalent geolatte geometry- Parameters:
jtsGeometry- the jts geometry to convert- Returns:
- an equivalent geolatte geometry
- Throws:
IllegalArgumentException- when a null object is passed
-
from
public static <P extends Position> Geometry<P> from(org.locationtech.jts.geom.Geometry jtsGeometry, CoordinateReferenceSystem<P> crs)
Factory method that converts a JTS geometry into an equivalent geolatte geometry and allows the caller to specify the CoordinateReferenceSystem of the resulting geolatte geometry.- Parameters:
jtsGeometry- the jtsGeometrycrs- the CoordinateReferenceSystem- Returns:
- A geolatte geometry that corresponds with the given JTS geometry
- Throws:
IllegalArgumentException- when a null object is passed
-
to
public static <P extends Position> org.locationtech.jts.geom.Geometry to(Geometry<P> geometry, org.locationtech.jts.geom.GeometryFactory gFact)
Primary factory method that converts a geolatte geometry into an equivalent jts geometry- Parameters:
geometry- the geolatte geometry to start fromgFact- the GeometryFactory to use for creating the JTS Geometry- Returns:
- the equivalent JTS geometry
- Throws:
IllegalArgumentException- when a null object is passed
-
from
public static Envelope<C2D> from(org.locationtech.jts.geom.Envelope jtsEnvelope)
Converts a JTSEnvelopeto a geolatteEnvelope.- Parameters:
jtsEnvelope- the JTS Envelope to convert- Returns:
- the corresponding geolatte Envelope.
- Throws:
IllegalArgumentException- when a null object is passed
-
from
public static <P extends Position> Envelope<P> from(org.locationtech.jts.geom.Envelope jtsEnvelope, CoordinateReferenceSystem<P> crs)
Converts a JTSEnvelopeto a geolatteEnvelopewith the specified CRS.- Parameters:
jtsEnvelope- the JTS Envelope to convert.crs- theCoordinateReferenceSystemto use for the return value.- Returns:
- the corresponding geolatte Envelope, having the CRS specified in the crsId parameter.
- Throws:
IllegalArgumentException- when a null object is passed
-
to
public static org.locationtech.jts.geom.Envelope to(Envelope<?> env)
Converts a GeolatteEnvelopeto a JTSEnvelope.- Parameters:
env- the geolatte Envelope.- Returns:
- the corresponding JTS Envelope.
- Throws:
IllegalArgumentException- when a null object is passed
-
-