Package org.apache.sedona.common.raster
Class RasterPredicates
java.lang.Object
org.apache.sedona.common.raster.RasterPredicates
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisCRSMatchesSRID(org.geotools.api.referencing.crs.CoordinateReferenceSystem crs, int srid) Test if crs matches the EPSG code.static booleanrsContains(org.geotools.coverage.grid.GridCoverage2D left, org.geotools.coverage.grid.GridCoverage2D right) static booleanrsContains(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry geometry) static booleanrsIntersects(org.geotools.coverage.grid.GridCoverage2D left, org.geotools.coverage.grid.GridCoverage2D right) static booleanrsIntersects(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry geometry) Test if a raster intersects a query window.static booleanrsWithin(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry geometry)
-
Constructor Details
-
RasterPredicates
public RasterPredicates()
-
-
Method Details
-
rsIntersects
public static boolean rsIntersects(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry geometry) Test if a raster intersects a query window. If both the raster and the query window have a CRS, the query window and the envelope of the raster will be transformed to a common CRS before testing for intersection. Please note that the CRS transformation will be lenient, which means that the transformation may not be accurate.- Parameters:
raster- the rastergeometry- the query window- Returns:
- true if the raster intersects the query window
-
rsContains
public static boolean rsContains(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry geometry) -
rsWithin
public static boolean rsWithin(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry geometry) -
rsIntersects
public static boolean rsIntersects(org.geotools.coverage.grid.GridCoverage2D left, org.geotools.coverage.grid.GridCoverage2D right) -
rsContains
public static boolean rsContains(org.geotools.coverage.grid.GridCoverage2D left, org.geotools.coverage.grid.GridCoverage2D right) -
isCRSMatchesSRID
public static boolean isCRSMatchesSRID(org.geotools.api.referencing.crs.CoordinateReferenceSystem crs, int srid) Test if crs matches the EPSG code. This method tries to avoid the expensive CRS.decode and CRS.equalsIgnoreMetadata calls. If the crs has an identifier matching the EPSG code, we assume that the crs matches the EPSG code.- Parameters:
crs- The crs to testsrid- The SRID to test. The axis-order of the decoded CRS is assumed to be in lon/lat order- Returns:
- true if the crs matches the EPSG code, false otherwise
-