Class 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 JTS Envelope to a geolatte Envelope.
      static <P extends Position>
      Envelope<P>
      from​(org.locationtech.jts.geom.Envelope jtsEnvelope, CoordinateReferenceSystem<P> crs)
      Converts a JTS Envelope to a geolatte Envelope with the specified CRS.
      static Geometry<?> from​(org.locationtech.jts.geom.Geometry jtsGeometry)
      Primary Factory method that converts a JTS geometry into an equivalent geolatte geometry
      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.
      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.Envelope to​(Envelope<?> env)
      Converts a Geolatte Envelope to a JTS Envelope.
      static <P extends Position>
      org.locationtech.jts.geom.Geometry
      to​(Geometry<P> geometry)  
      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
    • Constructor Detail

      • JTS

        public JTS()
    • 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 PositionGeometry<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 jtsGeometry
        crs - 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 from
        gFact - the GeometryFactory to use for creating the JTS Geometry
        Returns:
        the equivalent 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)
      • from

        public static Envelope<C2D> from​(org.locationtech.jts.geom.Envelope jtsEnvelope)
        Converts a JTS Envelope to a geolatte Envelope.
        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 PositionEnvelope<P> from​(org.locationtech.jts.geom.Envelope jtsEnvelope,
                                                            CoordinateReferenceSystem<P> crs)
        Converts a JTS Envelope to a geolatte Envelope with the specified CRS.
        Parameters:
        jtsEnvelope - the JTS Envelope to convert.
        crs - the CoordinateReferenceSystem to 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 Geolatte Envelope to a JTS Envelope.
        Parameters:
        env - the geolatte Envelope.
        Returns:
        the corresponding JTS Envelope.
        Throws:
        IllegalArgumentException - when a null object is passed