Package org.apache.sedona.common.raster
Class PixelFunctionEditors
java.lang.Object
org.apache.sedona.common.raster.PixelFunctionEditors
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.geotools.coverage.grid.GridCoverage2DsetValue(org.geotools.coverage.grid.GridCoverage2D raster, int colX, int rowY, double newValue) Return a raster by updated the pixel specified by pixel location.static org.geotools.coverage.grid.GridCoverage2DsetValue(org.geotools.coverage.grid.GridCoverage2D raster, int band, int colX, int rowY, double newValue) Return a raster by updated the pixel specified by pixel location.static org.geotools.coverage.grid.GridCoverage2DsetValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, int colX, int rowY, int width, int height, double[] values) Returns a raster by replacing the values of pixels in a specified rectangular region.static org.geotools.coverage.grid.GridCoverage2DsetValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, int colX, int rowY, int width, int height, double[] values, boolean keepNoData) Returns a raster by replacing the values of pixels in a specified rectangular region.static org.geotools.coverage.grid.GridCoverage2DsetValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geom, double value) Returns a raster by replacing the values of pixels in a specified geometry region.static org.geotools.coverage.grid.GridCoverage2DsetValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geom, double value, boolean allTouched) Returns a raster by replacing the values of pixels in a specified geometry region.static org.geotools.coverage.grid.GridCoverage2DsetValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geom, double value, boolean allTouched, boolean keepNoData) Returns a raster by replacing the values of pixels in a specified geometry region.
-
Constructor Details
-
PixelFunctionEditors
public PixelFunctionEditors()
-
-
Method Details
-
setValues
public static org.geotools.coverage.grid.GridCoverage2D setValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, int colX, int rowY, int width, int height, double[] values, boolean keepNoData) Returns a raster by replacing the values of pixels in a specified rectangular region.- Parameters:
raster- Raster to be editedband- Band of the raster to be editedcolX- UpperLeftX of the regionrowY- UpperLeftY of the regionwidth- Width of the said regionheight- Height of the said regionvalues- Array of values to be inserted into the said regionkeepNoData- To keep No Data value or add the given value to the raster- Returns:
- An updated Raster
-
setValues
public static org.geotools.coverage.grid.GridCoverage2D setValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, int colX, int rowY, int width, int height, double[] values) Returns a raster by replacing the values of pixels in a specified rectangular region. Convenience function without keepNoData parameter.- Parameters:
raster- Raster to be editedband- Band of the raster to be editedcolX- UpperLeftX of the regionrowY- UpperLeftY of the regionwidth- Width of the said regionheight- Height of the said regionvalues- Array of values to be inserted into the said region- Returns:
- An updated Raster
-
setValues
public static org.geotools.coverage.grid.GridCoverage2D setValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geom, double value, boolean allTouched, boolean keepNoData) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException Returns a raster by replacing the values of pixels in a specified geometry region. It converts the Geometry to a raster using RS_AsRaster.- Parameters:
raster- Raster to be editedband- Band of the raster to be editedgeom- Geometry region to updatevalue- Value to updated in the said regionallTouched- When set to true, sets value for all pixels touched by geomkeepNoData- To keep no data value or not- Returns:
- An updated raster
- Throws:
org.geotools.api.referencing.FactoryExceptionorg.geotools.api.referencing.operation.TransformException
-
setValues
public static org.geotools.coverage.grid.GridCoverage2D setValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geom, double value, boolean allTouched) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException Returns a raster by replacing the values of pixels in a specified geometry region. It converts the Geometry to a raster using RS_AsRaster. A convenience function with keepNoData as false.- Parameters:
raster- Input raster to be updatedband- Band of the raster to be editedgeom- Geometry region to updatevalue- Value to updated in the said regionallTouched- When set to true, sets value for all pixels touched by geom- Returns:
- An updated raster
- Throws:
org.geotools.api.referencing.FactoryExceptionorg.geotools.api.referencing.operation.TransformException
-
setValues
public static org.geotools.coverage.grid.GridCoverage2D setValues(org.geotools.coverage.grid.GridCoverage2D raster, int band, org.locationtech.jts.geom.Geometry geom, double value) throws org.geotools.api.referencing.FactoryException, org.geotools.api.referencing.operation.TransformException Returns a raster by replacing the values of pixels in a specified geometry region. It converts the Geometry to a raster using RS_AsRaster. A convenience function with keepNoData as false.- Parameters:
raster- Input raster to be updatedband- Band of the raster to be editedgeom- Geometry region to updatevalue- Value to updated in the said region- Returns:
- An updated raster
- Throws:
org.geotools.api.referencing.FactoryExceptionorg.geotools.api.referencing.operation.TransformException
-
setValue
public static org.geotools.coverage.grid.GridCoverage2D setValue(org.geotools.coverage.grid.GridCoverage2D raster, int band, int colX, int rowY, double newValue) Return a raster by updated the pixel specified by pixel location.- Parameters:
raster- Input raster to be editedband- Band of the raster to be updatedcolX- Column of the pixelrowY- Row of the pixelnewValue- New value to be updated- Returns:
- An updated raster
-
setValue
public static org.geotools.coverage.grid.GridCoverage2D setValue(org.geotools.coverage.grid.GridCoverage2D raster, int colX, int rowY, double newValue) Return a raster by updated the pixel specified by pixel location.- Parameters:
raster- Input raster to be editedcolX- Column of the pixelrowY- Row of the pixelnewValue- New value to be updated- Returns:
- An updated raster
-