Class RasterBandEditors

java.lang.Object
org.apache.sedona.common.raster.RasterBandEditors

public class RasterBandEditors extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.geotools.coverage.grid.GridCoverage2D
    addBand(org.geotools.coverage.grid.GridCoverage2D toRaster, org.geotools.coverage.grid.GridCoverage2D fromRaster)
    Index of fromRaster will be taken as 1 and will be copied at the end of the toRaster
    static org.geotools.coverage.grid.GridCoverage2D
    addBand(org.geotools.coverage.grid.GridCoverage2D toRaster, org.geotools.coverage.grid.GridCoverage2D fromRaster, int fromBand)
    The new band will be added to the end of the toRaster
    static org.geotools.coverage.grid.GridCoverage2D
    addBand(org.geotools.coverage.grid.GridCoverage2D toRaster, org.geotools.coverage.grid.GridCoverage2D fromRaster, int fromBand, int toRasterIndex)
     
    static org.geotools.coverage.grid.GridCoverage2D
    clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry)
    Return a clipped raster with the specified ROI by the geometry.
    static org.geotools.coverage.grid.GridCoverage2D
    clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry, boolean allTouched)
    Return a clipped raster with the specified ROI by the geometry.
    static org.geotools.coverage.grid.GridCoverage2D
    clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry, boolean allTouched, double noDataValue)
    Return a clipped raster with the specified ROI by the geometry.
    static org.geotools.coverage.grid.GridCoverage2D
    clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry, boolean allTouched, double noDataValue, boolean crop)
    Return a clipped raster with the specified ROI by the geometry
    static org.geotools.coverage.grid.GridCoverage2D
    clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry, boolean allTouched, double noDataValue, boolean crop, boolean lenient)
    Return a clipped raster with the specified ROI by the geometry
    static org.geotools.coverage.grid.GridCoverage2D
    crop(org.geotools.coverage.grid.GridCoverage2D raster, double noDataValue, org.locationtech.jts.geom.Geometry geomExtent, boolean lenient)
     
    static org.geotools.coverage.grid.GridCoverage2D
    rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2)
     
    static org.geotools.coverage.grid.GridCoverage2D
    rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3)
     
    static org.geotools.coverage.grid.GridCoverage2D
    rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3, org.geotools.coverage.grid.GridCoverage2D raster4)
     
    static org.geotools.coverage.grid.GridCoverage2D
    rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3, org.geotools.coverage.grid.GridCoverage2D raster4, org.geotools.coverage.grid.GridCoverage2D raster5)
     
    static org.geotools.coverage.grid.GridCoverage2D
    rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3, org.geotools.coverage.grid.GridCoverage2D raster4, org.geotools.coverage.grid.GridCoverage2D raster5, org.geotools.coverage.grid.GridCoverage2D raster6)
     
    static org.geotools.coverage.grid.GridCoverage2D
    rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3, org.geotools.coverage.grid.GridCoverage2D raster4, org.geotools.coverage.grid.GridCoverage2D raster5, org.geotools.coverage.grid.GridCoverage2D raster6, org.geotools.coverage.grid.GridCoverage2D raster7)
     
    static org.geotools.coverage.grid.GridCoverage2D
    setBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, int bandIndex, Double noDataValue)
    Adds no-data value to the raster.
    static org.geotools.coverage.grid.GridCoverage2D
    setBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, int bandIndex, Double noDataValue, boolean replace)
    Adds no-data value to the raster.
    static org.geotools.coverage.grid.GridCoverage2D
    setBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, Double noDataValue)
    Adds no-data value to the raster.

    Methods inherited from class java.lang.Object

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

    • RasterBandEditors

      public RasterBandEditors()
  • Method Details

    • setBandNoDataValue

      public static org.geotools.coverage.grid.GridCoverage2D setBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, int bandIndex, Double noDataValue, boolean replace)
      Adds no-data value to the raster.
      Parameters:
      raster - Source raster to add no-data value
      bandIndex - Band index to add no-data value
      noDataValue - Value to set as no-data value, if null then remove existing no-data value
      replace - if true replaces the previous no-data value with the specified no-data value
      Returns:
      Raster with no-data value
    • setBandNoDataValue

      public static org.geotools.coverage.grid.GridCoverage2D setBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, int bandIndex, Double noDataValue)
      Adds no-data value to the raster.
      Parameters:
      raster - Source raster to add no-data value
      bandIndex - Band index to add no-data value
      noDataValue - Value to set as no-data value, if null then remove existing no-data value
      Returns:
      Raster with no-data value
    • setBandNoDataValue

      public static org.geotools.coverage.grid.GridCoverage2D setBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, Double noDataValue)
      Adds no-data value to the raster.
      Parameters:
      raster - Source raster to add no-data value
      noDataValue - Value to set as no-data value, if null then remove existing no-data value
      Returns:
      Raster with no-data value
    • addBand

      public static org.geotools.coverage.grid.GridCoverage2D addBand(org.geotools.coverage.grid.GridCoverage2D toRaster, org.geotools.coverage.grid.GridCoverage2D fromRaster, int fromBand, int toRasterIndex)
      Parameters:
      toRaster - Raster to add the band
      fromRaster - Raster from the band will be copied
      fromBand - Index of Raster band that will be copied
      toRasterIndex - Index of Raster where the copied band will be changed
      Returns:
      A raster with either replacing a band or adding a new band at the end the toRaster, with the specified band values extracted from the fromRaster at given band
    • addBand

      public static org.geotools.coverage.grid.GridCoverage2D addBand(org.geotools.coverage.grid.GridCoverage2D toRaster, org.geotools.coverage.grid.GridCoverage2D fromRaster, int fromBand)
      The new band will be added to the end of the toRaster
      Parameters:
      toRaster - Raster to add the band
      fromRaster - Raster from the band will be copied
      fromBand - Index of Raster band that will be copied
      Returns:
      A raster with either replacing a band or adding a new band at the end the toRaster, with the specified band values extracted from the fromRaster at given band
    • addBand

      public static org.geotools.coverage.grid.GridCoverage2D addBand(org.geotools.coverage.grid.GridCoverage2D toRaster, org.geotools.coverage.grid.GridCoverage2D fromRaster)
      Index of fromRaster will be taken as 1 and will be copied at the end of the toRaster
      Parameters:
      toRaster - Raster to add the band
      fromRaster - Raster from the band will be copied
      Returns:
      A raster with either replacing a band or adding a new band at the end the toRaster, with the specified band values extracted from the fromRaster at given band
    • rasterUnion

      public static org.geotools.coverage.grid.GridCoverage2D rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3, org.geotools.coverage.grid.GridCoverage2D raster4, org.geotools.coverage.grid.GridCoverage2D raster5, org.geotools.coverage.grid.GridCoverage2D raster6, org.geotools.coverage.grid.GridCoverage2D raster7)
    • rasterUnion

      public static org.geotools.coverage.grid.GridCoverage2D rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3, org.geotools.coverage.grid.GridCoverage2D raster4, org.geotools.coverage.grid.GridCoverage2D raster5, org.geotools.coverage.grid.GridCoverage2D raster6)
    • rasterUnion

      public static org.geotools.coverage.grid.GridCoverage2D rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3, org.geotools.coverage.grid.GridCoverage2D raster4, org.geotools.coverage.grid.GridCoverage2D raster5)
    • rasterUnion

      public static org.geotools.coverage.grid.GridCoverage2D rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3, org.geotools.coverage.grid.GridCoverage2D raster4)
    • rasterUnion

      public static org.geotools.coverage.grid.GridCoverage2D rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3)
    • rasterUnion

      public static org.geotools.coverage.grid.GridCoverage2D rasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2)
    • crop

      public static org.geotools.coverage.grid.GridCoverage2D crop(org.geotools.coverage.grid.GridCoverage2D raster, double noDataValue, org.locationtech.jts.geom.Geometry geomExtent, boolean lenient)
    • clip

      public static org.geotools.coverage.grid.GridCoverage2D clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry, boolean allTouched, double noDataValue, boolean crop, boolean lenient) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException
      Return a clipped raster with the specified ROI by the geometry
      Parameters:
      raster - Raster to clip
      band - Band number to perform clipping
      geometry - Specify ROI
      allTouched - Include all pixels touched by roi geometry
      noDataValue - no-Data value for empty cells
      crop - Specifies to keep the original extent or not
      lenient - Return null if the raster and geometry do not intersect when set to true, otherwise will throw an exception
      Returns:
      A clip Raster with defined ROI by the geometry
      Throws:
      org.geotools.api.referencing.FactoryException
      org.geotools.api.referencing.operation.TransformException
    • clip

      public static org.geotools.coverage.grid.GridCoverage2D clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry, boolean allTouched, double noDataValue, boolean crop) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException
      Return a clipped raster with the specified ROI by the geometry
      Parameters:
      raster - Raster to clip
      band - Band number to perform clipping
      geometry - Specify ROI
      allTouched - Include all pixels touched by roi geometry
      noDataValue - no-Data value for empty cells
      crop - Specifies to keep the original extent or not
      Returns:
      A clip Raster with defined ROI by the geometry
      Throws:
      org.geotools.api.referencing.FactoryException
      org.geotools.api.referencing.operation.TransformException
    • clip

      public static org.geotools.coverage.grid.GridCoverage2D clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry, boolean allTouched, double noDataValue) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException
      Return a clipped raster with the specified ROI by the geometry.
      Parameters:
      raster - Raster to clip
      band - Band number to perform clipping
      geometry - Specify ROI
      allTouched - Include all pixels touched by roi geometry
      noDataValue - no-Data value for empty cells
      Returns:
      A clip Raster with defined ROI by the geometry
      Throws:
      org.geotools.api.referencing.FactoryException
      org.geotools.api.referencing.operation.TransformException
    • clip

      public static org.geotools.coverage.grid.GridCoverage2D clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry, boolean allTouched) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException
      Return a clipped raster with the specified ROI by the geometry. No-data value will be taken as the lowest possible value for the data type and crop will be `true`.
      Parameters:
      raster - Raster to clip
      band - Band number to perform clipping
      geometry - Specify ROI
      allTouched - Include all pixels touched by roi geometry
      Returns:
      A clip Raster with defined ROI by the geometry
      Throws:
      org.geotools.api.referencing.FactoryException
      org.geotools.api.referencing.operation.TransformException
    • clip

      public static org.geotools.coverage.grid.GridCoverage2D clip(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geometry) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException
      Return a clipped raster with the specified ROI by the geometry. No-data value will be taken as the lowest possible value for the data type and crop will be `true`.
      Parameters:
      raster - Raster to clip
      band - Band number to perform clipping
      geometry - Specify ROI
      Returns:
      A clip Raster with defined ROI by the geometry
      Throws:
      org.geotools.api.referencing.FactoryException
      org.geotools.api.referencing.operation.TransformException