Class FunctionsGeoTools

java.lang.Object
org.apache.sedona.common.FunctionsGeoTools

public class FunctionsGeoTools extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.locationtech.jts.geom.Geometry
    bufferSpheroid(org.locationtech.jts.geom.Geometry geometry, double radius, org.locationtech.jts.operation.buffer.BufferParameters params)
     
    static int
    crsToSRID(org.geotools.api.referencing.crs.CoordinateReferenceSystem crs)
    Get the SRID of a CRS.
    static org.geotools.api.referencing.crs.CoordinateReferenceSystem
    sridToCRS(int srid)
    Decode SRID to CRS, forcing axis order to be lon/lat
    static org.locationtech.jts.geom.Geometry
    transform(org.locationtech.jts.geom.Geometry geometry, String targetCRS)
     
    static org.locationtech.jts.geom.Geometry
    transform(org.locationtech.jts.geom.Geometry geometry, String sourceCRS, String targetCRS)
     
    static org.locationtech.jts.geom.Geometry
    transform(org.locationtech.jts.geom.Geometry geometry, String sourceCRScode, String targetCRScode, boolean lenient)
     
    static org.locationtech.jts.geom.Geometry
    transformToGivenTarget(org.locationtech.jts.geom.Geometry geometry, String sourceCRScode, org.geotools.api.referencing.crs.CoordinateReferenceSystem targetCRS, boolean lenient)
    Transform a geometry from one CRS to another.
    static org.locationtech.jts.geom.Geometry
    voronoiPolygons(org.locationtech.jts.geom.Geometry geom, double tolerance, org.locationtech.jts.geom.Geometry extendTo)
     
    static int
    Get the SRID of a CRS from a WKT string

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FunctionsGeoTools

      public FunctionsGeoTools()
  • Method Details

    • transform

      public static org.locationtech.jts.geom.Geometry transform(org.locationtech.jts.geom.Geometry geometry, String targetCRS) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException
      Throws:
      org.geotools.api.referencing.FactoryException
      org.geotools.api.referencing.operation.TransformException
    • transform

      public static org.locationtech.jts.geom.Geometry transform(org.locationtech.jts.geom.Geometry geometry, String sourceCRS, String targetCRS) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException
      Throws:
      org.geotools.api.referencing.FactoryException
      org.geotools.api.referencing.operation.TransformException
    • transform

      public static org.locationtech.jts.geom.Geometry transform(org.locationtech.jts.geom.Geometry geometry, String sourceCRScode, String targetCRScode, boolean lenient) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException
      Throws:
      org.geotools.api.referencing.FactoryException
      org.geotools.api.referencing.operation.TransformException
    • transformToGivenTarget

      public static org.locationtech.jts.geom.Geometry transformToGivenTarget(org.locationtech.jts.geom.Geometry geometry, String sourceCRScode, org.geotools.api.referencing.crs.CoordinateReferenceSystem targetCRS, boolean lenient) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException
      Transform a geometry from one CRS to another. If sourceCRS is not specified, it will be extracted from the geometry. If lenient is true, the transformation will be lenient. This function is used by the implicit CRS transformation in Sedona rasters.
      Parameters:
      geometry -
      sourceCRScode -
      targetCRS -
      lenient -
      Returns:
      Throws:
      org.geotools.api.referencing.FactoryException
      org.geotools.api.referencing.operation.TransformException
    • wktCRSToSRID

      public static int wktCRSToSRID(String crsWKT)
      Get the SRID of a CRS from a WKT string
      Parameters:
      crsWKT - WKT string for CRS
      Returns:
      SRID
    • crsToSRID

      public static int crsToSRID(org.geotools.api.referencing.crs.CoordinateReferenceSystem crs)
      Get the SRID of a CRS. We use the EPSG code of the CRS if available.
      Parameters:
      crs - CoordinateReferenceSystem
      Returns:
      SRID
    • sridToCRS

      public static org.geotools.api.referencing.crs.CoordinateReferenceSystem sridToCRS(int srid)
      Decode SRID to CRS, forcing axis order to be lon/lat
      Parameters:
      srid - SRID
      Returns:
      CoordinateReferenceSystem object
    • voronoiPolygons

      public static org.locationtech.jts.geom.Geometry voronoiPolygons(org.locationtech.jts.geom.Geometry geom, double tolerance, org.locationtech.jts.geom.Geometry extendTo)
    • bufferSpheroid

      public static org.locationtech.jts.geom.Geometry bufferSpheroid(org.locationtech.jts.geom.Geometry geometry, double radius, org.locationtech.jts.operation.buffer.BufferParameters params) throws IllegalArgumentException
      Throws:
      IllegalArgumentException