Package org.apache.sedona.common.raster
Class RasterBandEditors
java.lang.Object
org.apache.sedona.common.raster.RasterBandEditors
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.geotools.coverage.grid.GridCoverage2DaddBand(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 toRasterstatic org.geotools.coverage.grid.GridCoverage2DaddBand(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 toRasterstatic org.geotools.coverage.grid.GridCoverage2DaddBand(org.geotools.coverage.grid.GridCoverage2D toRaster, org.geotools.coverage.grid.GridCoverage2D fromRaster, int fromBand, int toRasterIndex) static org.geotools.coverage.grid.GridCoverage2Dclip(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.GridCoverage2Dclip(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.GridCoverage2Dclip(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.GridCoverage2Dclip(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 geometrystatic org.geotools.coverage.grid.GridCoverage2Dclip(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 geometrystatic org.geotools.coverage.grid.GridCoverage2Dcrop(org.geotools.coverage.grid.GridCoverage2D raster, double noDataValue, org.locationtech.jts.geom.Geometry geomExtent, boolean lenient) static org.geotools.coverage.grid.GridCoverage2DrasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2) static org.geotools.coverage.grid.GridCoverage2DrasterUnion(org.geotools.coverage.grid.GridCoverage2D raster1, org.geotools.coverage.grid.GridCoverage2D raster2, org.geotools.coverage.grid.GridCoverage2D raster3) static org.geotools.coverage.grid.GridCoverage2DrasterUnion(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.GridCoverage2DrasterUnion(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.GridCoverage2DrasterUnion(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.GridCoverage2DrasterUnion(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.GridCoverage2DsetBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, int bandIndex, Double noDataValue) Adds no-data value to the raster.static org.geotools.coverage.grid.GridCoverage2DsetBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, int bandIndex, Double noDataValue, boolean replace) Adds no-data value to the raster.static org.geotools.coverage.grid.GridCoverage2DsetBandNoDataValue(org.geotools.coverage.grid.GridCoverage2D raster, Double noDataValue) Adds no-data value to the raster.
-
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 valuebandIndex- Band index to add no-data valuenoDataValue- Value to set as no-data value, if null then remove existing no-data valuereplace- 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 valuebandIndex- Band index to add no-data valuenoDataValue- 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 valuenoDataValue- 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 bandfromRaster- Raster from the band will be copiedfromBand- Index of Raster band that will be copiedtoRasterIndex- 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 bandfromRaster- Raster from the band will be copiedfromBand- 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 bandfromRaster- 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 clipband- Band number to perform clippinggeometry- Specify ROIallTouched- Include all pixels touched by roi geometrynoDataValue- no-Data value for empty cellscrop- Specifies to keep the original extent or notlenient- 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.FactoryExceptionorg.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 clipband- Band number to perform clippinggeometry- Specify ROIallTouched- Include all pixels touched by roi geometrynoDataValue- no-Data value for empty cellscrop- Specifies to keep the original extent or not- Returns:
- A clip Raster with defined ROI by the geometry
- Throws:
org.geotools.api.referencing.FactoryExceptionorg.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 clipband- Band number to perform clippinggeometry- Specify ROIallTouched- Include all pixels touched by roi geometrynoDataValue- no-Data value for empty cells- Returns:
- A clip Raster with defined ROI by the geometry
- Throws:
org.geotools.api.referencing.FactoryExceptionorg.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 clipband- Band number to perform clippinggeometry- Specify ROIallTouched- Include all pixels touched by roi geometry- Returns:
- A clip Raster with defined ROI by the geometry
- Throws:
org.geotools.api.referencing.FactoryExceptionorg.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 clipband- Band number to perform clippinggeometry- Specify ROI- Returns:
- A clip Raster with defined ROI by the geometry
- Throws:
org.geotools.api.referencing.FactoryExceptionorg.geotools.api.referencing.operation.TransformException
-