Package org.apache.sedona.common.raster
Class RasterBandAccessors
java.lang.Object
org.apache.sedona.common.raster.RasterBandAccessors
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanbandIsNoData(org.geotools.coverage.grid.GridCoverage2D raster) static booleanbandIsNoData(org.geotools.coverage.grid.GridCoverage2D raster, int band) Returns true if the band is filled with only nodata values.static org.geotools.coverage.grid.GridCoverage2DgetBand(org.geotools.coverage.grid.GridCoverage2D rasterGeom, int[] bandIndexes) static DoublegetBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster) static DoublegetBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, int band) static StringgetBandType(org.geotools.coverage.grid.GridCoverage2D raster) static StringgetBandType(org.geotools.coverage.grid.GridCoverage2D raster, int band) static longgetCount(org.geotools.coverage.grid.GridCoverage2D raster) static longgetCount(org.geotools.coverage.grid.GridCoverage2D raster, int band) static longgetCount(org.geotools.coverage.grid.GridCoverage2D raster, int band, boolean excludeNoDataValue) static doublegetSummaryStats(org.geotools.coverage.grid.GridCoverage2D rasterGeom, String statType) static doublegetSummaryStats(org.geotools.coverage.grid.GridCoverage2D rasterGeom, String statType, int band) static doublegetSummaryStats(org.geotools.coverage.grid.GridCoverage2D rasterGeom, String statType, int band, boolean excludeNoDataValue) static double[]getSummaryStatsAll(org.geotools.coverage.grid.GridCoverage2D raster) static double[]getSummaryStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, int band) static double[]getSummaryStatsAll(org.geotools.coverage.grid.GridCoverage2D rasterGeom, int band, boolean excludeNoDataValue) static DoublegetZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, String statType) static DoublegetZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, String statType, boolean allTouched) static DoublegetZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, String statType, boolean allTouched, boolean excludeNoData) static DoublegetZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, String statType, boolean allTouched, boolean excludeNoData, boolean lenient) static DoublegetZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, String statType) static Double[]getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi) static Double[]getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band) static Double[]getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, boolean allTouched) static Double[]getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, boolean allTouched, boolean excludeNoData) static Double[]getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, boolean allTouched, boolean excludeNoData, boolean lenient)
-
Constructor Details
-
RasterBandAccessors
public RasterBandAccessors()
-
-
Method Details
-
getBandNoDataValue
-
getBandNoDataValue
-
getCount
public static long getCount(org.geotools.coverage.grid.GridCoverage2D raster, int band, boolean excludeNoDataValue) -
getCount
public static long getCount(org.geotools.coverage.grid.GridCoverage2D raster) -
getCount
public static long getCount(org.geotools.coverage.grid.GridCoverage2D raster, int band) -
getZonalStatsAll
public static Double[] getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, boolean allTouched, boolean excludeNoData, boolean lenient) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of interestband- Band to be used for computationallTouched- Include pixels touched by roi geometryexcludeNoData- Specifies whether to exclude no-data value or notlenient- Return null if the raster and roi do not intersect when set to true, otherwise will throw an exception- Returns:
- An array with all the stats for the region
- Throws:
org.geotools.api.referencing.FactoryException
-
getZonalStatsAll
public static Double[] getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, boolean allTouched, boolean excludeNoData) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of interestband- Band to be used for computationallTouched- Include pixels touched by roi geometryexcludeNoData- Specifies whether to exclude no-data value or not- Returns:
- An array with all the stats for the region
- Throws:
org.geotools.api.referencing.FactoryException
-
getZonalStatsAll
public static Double[] getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, boolean allTouched) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of interestband- Band to be used for computationallTouched- Include pixels touched by roi geometry- Returns:
- An array with all the stats for the region, excludeNoData is set to true
- Throws:
org.geotools.api.referencing.FactoryException
-
getZonalStatsAll
public static Double[] getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of interestband- Band to be used for computation- Returns:
- An array with all the stats for the region, excludeNoData is set to true
- Throws:
org.geotools.api.referencing.FactoryException
-
getZonalStatsAll
public static Double[] getZonalStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of interest- Returns:
- An array with all the stats for the region, excludeNoData is set to true and band is set to 1
- Throws:
org.geotools.api.referencing.FactoryException
-
getZonalStats
public static Double getZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, String statType, boolean allTouched, boolean excludeNoData, boolean lenient) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of interestband- Band to be used for computationstatType- Define the statistic to be computedallTouched- Include pixels touched by roi geometryexcludeNoData- Specifies whether to exclude no-data value or notlenient- Return null if the raster and roi do not intersect when set to true, otherwise will throw an exception- Returns:
- A double precision floating point number representing the requested statistic calculated over the specified region.
- Throws:
org.geotools.api.referencing.FactoryException
-
getZonalStats
public static Double getZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, String statType, boolean allTouched, boolean excludeNoData) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of interestband- Band to be used for computationstatType- Define the statistic to be computedallTouched- Include pixels touched by roi geometryexcludeNoData- Specifies whether to exclude no-data value or not- Returns:
- A double precision floating point number representing the requested statistic calculated over the specified region.
- Throws:
org.geotools.api.referencing.FactoryException
-
getZonalStats
public static Double getZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, String statType, boolean allTouched) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of interestband- Band to be used for computationstatType- Define the statistic to be computedallTouched- Include pixels touched by roi geometry- Returns:
- A double precision floating point number representing the requested statistic calculated over the specified region. The excludeNoData is set to true.
- Throws:
org.geotools.api.referencing.FactoryException
-
getZonalStats
public static Double getZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, int band, String statType) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of interestband- Band to be used for computationstatType- Define the statistic to be computed- Returns:
- A double precision floating point number representing the requested statistic calculated over the specified region. The excludeNoData is set to true.
- Throws:
org.geotools.api.referencing.FactoryException
-
getZonalStats
public static Double getZonalStats(org.geotools.coverage.grid.GridCoverage2D raster, org.locationtech.jts.geom.Geometry roi, String statType) throws org.geotools.api.referencing.FactoryException - Parameters:
raster- Raster to use for computing statsroi- Geometry to define the region of intereststatType- Define the statistic to be computed- Returns:
- A double precision floating point number representing the requested statistic calculated over the specified region. The excludeNoData is set to true and band is set to 1.
- Throws:
org.geotools.api.referencing.FactoryException
-
getSummaryStats
public static double getSummaryStats(org.geotools.coverage.grid.GridCoverage2D rasterGeom, String statType, int band, boolean excludeNoDataValue) -
getSummaryStats
public static double getSummaryStats(org.geotools.coverage.grid.GridCoverage2D rasterGeom, String statType, int band) -
getSummaryStats
public static double getSummaryStats(org.geotools.coverage.grid.GridCoverage2D rasterGeom, String statType) -
getSummaryStatsAll
public static double[] getSummaryStatsAll(org.geotools.coverage.grid.GridCoverage2D rasterGeom, int band, boolean excludeNoDataValue) -
getSummaryStatsAll
public static double[] getSummaryStatsAll(org.geotools.coverage.grid.GridCoverage2D raster, int band) -
getSummaryStatsAll
public static double[] getSummaryStatsAll(org.geotools.coverage.grid.GridCoverage2D raster) -
getBand
public static org.geotools.coverage.grid.GridCoverage2D getBand(org.geotools.coverage.grid.GridCoverage2D rasterGeom, int[] bandIndexes) throws org.geotools.api.referencing.FactoryException - Parameters:
rasterGeom- The raster where the bands will be extracted from.bandIndexes- The bands to be added to new raster.- Returns:
- Raster with the specified bands.
- Throws:
org.geotools.api.referencing.FactoryException
-
getBandType
-
getBandType
-
bandIsNoData
public static boolean bandIsNoData(org.geotools.coverage.grid.GridCoverage2D raster, int band) Returns true if the band is filled with only nodata values.- Parameters:
raster- The raster to checkband- The 1-based index of band to check- Returns:
- true if the band is filled with only nodata values, false otherwise
-
bandIsNoData
public static boolean bandIsNoData(org.geotools.coverage.grid.GridCoverage2D raster)
-