Package org.apache.sedona.common
Class FunctionsGeoTools
java.lang.Object
org.apache.sedona.common.FunctionsGeoTools
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.locationtech.jts.geom.GeometrybufferSpheroid(org.locationtech.jts.geom.Geometry geometry, double radius, org.locationtech.jts.operation.buffer.BufferParameters params) static intcrsToSRID(org.geotools.api.referencing.crs.CoordinateReferenceSystem crs) Get the SRID of a CRS.static org.geotools.api.referencing.crs.CoordinateReferenceSystemsridToCRS(int srid) Decode SRID to CRS, forcing axis order to be lon/latstatic org.locationtech.jts.geom.Geometrystatic org.locationtech.jts.geom.Geometrystatic org.locationtech.jts.geom.Geometrytransform(org.locationtech.jts.geom.Geometry geometry, String sourceCRScode, String targetCRScode, boolean lenient) static org.locationtech.jts.geom.GeometrytransformToGivenTarget(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.GeometryvoronoiPolygons(org.locationtech.jts.geom.Geometry geom, double tolerance, org.locationtech.jts.geom.Geometry extendTo) static intwktCRSToSRID(String crsWKT) Get the SRID of a CRS from a WKT string
-
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.FactoryExceptionorg.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.FactoryExceptionorg.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.FactoryExceptionorg.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.FactoryExceptionorg.geotools.api.referencing.operation.TransformException
-
wktCRSToSRID
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
-