Package org.teiid.geo

Class GeometryTransformUtils


  • public class GeometryTransformUtils
    extends Object
    Wrapper around proj4j library to transform geometries to different coordinate systems (ST_Transform).
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static org.osgeo.proj4j.ProjCoordinate[] convert​(org.locationtech.jts.geom.Coordinate[] jtsCoords)
      Convert JTS coordinates to proj4j coordinates.
      protected static org.locationtech.jts.geom.Coordinate[] convert​(org.osgeo.proj4j.ProjCoordinate[] projCoords)
      Convert proj4 coordinates to JTS coordinates.
      static boolean isLatLong​(CommandContext ctx, int srid)  
      static String lookupProj4Text​(CommandContext ctx, int srid)
      Lookup proj4 parameters in SPATIAL_REF_SYS using SRID as key.
      static org.locationtech.jts.geom.Geometry transform​(org.locationtech.jts.geom.Geometry geom, String srcParams, String tgtParams)
      Convert geometry to different coordinate system given the source/target proj4 parameters.
      static GeometryType transform​(CommandContext ctx, GeometryType geom, int srid)
      Convert geometry to a different coordinate system.
      protected static org.locationtech.jts.geom.Coordinate[] transformCoordinates​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.Coordinate[] in)  
      protected static org.osgeo.proj4j.ProjCoordinate[] transformCoordinates​(org.osgeo.proj4j.CoordinateTransform ct, org.osgeo.proj4j.ProjCoordinate[] in)  
      protected static org.locationtech.jts.geom.Geometry transformGeometry​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.Geometry geom)  
      protected static org.locationtech.jts.geom.Geometry transformGeometryCollection​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.GeometryCollection geometryCollection)  
      protected static org.locationtech.jts.geom.Geometry transformLinearRing​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.LinearRing linearRing)  
      protected static org.locationtech.jts.geom.Geometry transformLineString​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.LineString lineString)  
      protected static org.locationtech.jts.geom.Geometry transformMultiLineString​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.MultiLineString multiLineString)  
      protected static org.locationtech.jts.geom.Geometry transformMultiPoint​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.MultiPoint multiPoint)  
      protected static org.locationtech.jts.geom.Geometry transformMultiPolygon​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.MultiPolygon multiPolygon)  
      protected static org.locationtech.jts.geom.Geometry transformPoint​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.Point point)  
      protected static org.locationtech.jts.geom.Polygon transformPolygon​(org.osgeo.proj4j.CoordinateTransform ct, org.locationtech.jts.geom.Polygon polygon)  
    • Constructor Detail

      • GeometryTransformUtils

        public GeometryTransformUtils()
    • Method Detail

      • transform

        public static org.locationtech.jts.geom.Geometry transform​(org.locationtech.jts.geom.Geometry geom,
                                                                   String srcParams,
                                                                   String tgtParams)
                                                            throws FunctionExecutionException
        Convert geometry to different coordinate system given the source/target proj4 parameters. Presumably these were pulled from SPATIAL_REF_SYS.
        Parameters:
        geom -
        srcParams -
        tgtParams -
        Returns:
        Throws:
        FunctionExecutionException
      • convert

        protected static org.locationtech.jts.geom.Coordinate[] convert​(org.osgeo.proj4j.ProjCoordinate[] projCoords)
        Convert proj4 coordinates to JTS coordinates.
        Parameters:
        projCoords -
        Returns:
      • convert

        protected static org.osgeo.proj4j.ProjCoordinate[] convert​(org.locationtech.jts.geom.Coordinate[] jtsCoords)
        Convert JTS coordinates to proj4j coordinates.
        Parameters:
        jtsCoords -
        Returns:
      • transformCoordinates

        protected static org.locationtech.jts.geom.Coordinate[] transformCoordinates​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                                     org.locationtech.jts.geom.Coordinate[] in)
      • transformCoordinates

        protected static org.osgeo.proj4j.ProjCoordinate[] transformCoordinates​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                                org.osgeo.proj4j.ProjCoordinate[] in)
      • transformPolygon

        protected static org.locationtech.jts.geom.Polygon transformPolygon​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                            org.locationtech.jts.geom.Polygon polygon)
      • transformPoint

        protected static org.locationtech.jts.geom.Geometry transformPoint​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                           org.locationtech.jts.geom.Point point)
      • transformLinearRing

        protected static org.locationtech.jts.geom.Geometry transformLinearRing​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                                org.locationtech.jts.geom.LinearRing linearRing)
      • transformLineString

        protected static org.locationtech.jts.geom.Geometry transformLineString​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                                org.locationtech.jts.geom.LineString lineString)
      • transformMultiPolygon

        protected static org.locationtech.jts.geom.Geometry transformMultiPolygon​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                                  org.locationtech.jts.geom.MultiPolygon multiPolygon)
      • transformMultiPoint

        protected static org.locationtech.jts.geom.Geometry transformMultiPoint​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                                org.locationtech.jts.geom.MultiPoint multiPoint)
      • transformMultiLineString

        protected static org.locationtech.jts.geom.Geometry transformMultiLineString​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                                     org.locationtech.jts.geom.MultiLineString multiLineString)
      • transformGeometryCollection

        protected static org.locationtech.jts.geom.Geometry transformGeometryCollection​(org.osgeo.proj4j.CoordinateTransform ct,
                                                                                        org.locationtech.jts.geom.GeometryCollection geometryCollection)
                                                                                 throws FunctionExecutionException
        Throws:
        FunctionExecutionException