class Raster extends java.lang.Object implements Renderable
A Raster
Modifiers | Name | Description |
---|---|---|
static class |
Raster.Divide |
|
static class |
Raster.Subtract |
Type | Name and description |
---|---|
GridCoverage2D |
coverage A GeoScript Raster wraps a GeoTools GridCoverage2D |
Format |
format The Format |
Projection |
proj |
Style |
style The Style |
java.lang.Object |
value |
Constructor and description |
---|
Raster(java.util.List data, Bounds bounds) Create a new Raster from a List of List of float values |
Raster(GridCoverage2D coverage, Format format) Create a Raster from a GeoTools GridCoverage2D. |
Raster(java.awt.image.RenderedImage image, Bounds bounds) Create a Raster from an Image and Bounds |
Raster(Bounds bounds, int width, int height, java.util.List<Band> bands) Create a new Raster form a Bounds, image size, and List of Bands |
Type Params | Return Type | Name and description |
---|---|---|
|
Raster |
absolute() Create a new Raster by calculating the absolute value for every cell. |
|
Raster |
add(Raster other) Add this Raster with another Raster |
|
Raster |
add(double value) Add a constant value to this Raster |
|
Raster |
add(java.util.List<java.lang.Double> values) Add a List of constant values to this Raster |
|
boolean |
contains(Point point) Determine whether this Raster contains the geographic Point |
|
boolean |
contains(int x, int y) Determine whether this Raster contains the pixel coordinates |
|
Layer |
contours(int band, java.lang.Object intervalOrLevels, boolean simplify, boolean smooth, Bounds bounds) Create contours |
|
Raster |
convolve(int radius) Calculate a convoluted version of the current Raster |
|
Raster |
convolve(int width, int height) Calculate a convoluted version of the current Raster |
|
Raster |
createShadedRelief(Map options, double scale, double altitude, double azimuth) Create a shaded relief Raster from the current Raster |
|
Raster |
crop(Bounds bounds) Crop this Raster |
|
Raster |
crop(Geometry geometry) Crop this Raster |
|
Raster |
crop(int x1, int y1, int x2, int y2) Crop this Raster using pixel coordinates |
|
void |
dispose() Dispose of this Raster |
|
Raster |
div(Raster other) Divide this Raster by another Raster |
|
Raster |
div(double value) Divide this Raster by a constant value |
|
Raster |
div(java.util.List<java.lang.Double> values) Divide this Raster by a List of constant values |
|
Raster |
divide(Raster other) Divide this Raster by another Raster |
|
Raster |
divide(double value) Divide this Raster by a constant value |
|
Raster |
divide(java.util.List<java.lang.Double> values) Divide this Raster by a List of constant values |
|
void |
eachCell(Map options, groovy.lang.Closure closure) Call the Closure for each cell in this Raster |
|
void |
eachWindow(Map options, groovy.lang.Closure closure) Call the Closure for each window of values in this Raster |
|
java.util.List |
eval(Point point, java.lang.String type) Get the value of the Raster at the given geographic Location. |
|
java.util.List |
eval(int x, int y, java.lang.String type) Get the value of the Raster at the given pixel Location. |
|
Raster |
exp() Create a new Raster by calculating the exponential value for every cell. |
|
Layer |
extractFootPrint(Map options) Extract the foot print of this Raster as a vector Layer |
|
java.util.List |
getAt(java.lang.Object p) Get the value of the Raster at the given geographic Location or pixel location. |
|
java.util.List<Band> |
getBands() Get the List of Bands |
|
java.util.List |
getBlockSize() Get the block size |
|
Bounds |
getBounds() Get the Bounds |
|
java.awt.image.BufferedImage |
getBufferedImage() Get a BufferedImage |
|
int |
getCols() Get the number of columns |
|
java.awt.image.Raster |
getData() Get the underlying java.awt.image.Raster |
|
Map |
getExtrema() Calculate the min and max values for each band in this Raster. |
|
Histogram |
getHistogram(Map options) Get a Histogram for this Raster |
|
java.awt.image.RenderedImage |
getImage() Get the RenderedImage |
|
java.util.List |
getMapLayers(Bounds bounds, java.util.List size) |
|
double |
getMaxValue(int band) Get the maximum value for a band. |
|
double |
getMinValue(int band) Get the minimum value for a band. |
|
java.lang.String |
getName() Get the Raster's name |
|
Map |
getNeighbors(java.lang.Object p, int band) Get the value of the neighboring cells: NW N NE E SE S SE W |
|
java.util.List |
getPixel(Point p) Get pixel coordinates from the geographic Point |
|
java.util.List |
getPixelSize() Get the pixel size |
|
Point |
getPoint(int x, int y) Get a geographic Point from pixel coordinates |
|
Layer |
getPointLayer(Map options) Convert this Raster into a Layer of Points |
|
Layer |
getPolygonLayer(Map options) Convert this Raster to a Layer of polygons. |
|
Projection |
getProj() Get the Projection |
|
int |
getRows() Get the number of rows |
|
java.util.List |
getSize() Get the size [w,h] or [columns,rows] |
|
java.lang.Object |
getValue(java.lang.Object p, int band, java.lang.String type) Get the value at the given geographic location (Point) or pixel location ([x,y]) for the given band |
|
java.lang.Object |
getValue(int x, int y, int band, java.lang.String type) Get the value at the given pixel location ([x,y]) for the given band |
|
java.util.List |
getValues(int x, int y, int w, int h, int band, boolean flat) Get a List of values from the Raster |
|
java.lang.String |
getValuesAsString(Map options, int x, int y, int w, int h, int band) Get values as a String |
|
Raster |
invert() Create a new Raster by inverting the values of this Raster |
|
Raster |
log() Create a new Raster by calculating the log value for every cell. |
|
static Raster |
merge(Map options, java.util.List<Raster> rasters) Merge a List of Rasters into one Raster |
|
Raster |
minus(Raster other) Subtract this Raster from an other Raster |
|
Raster |
minus(double value) Subtract this Raster from a constant value |
|
Raster |
minus(java.util.List<java.lang.Double> values) Subtract this Raster from a List of constant values |
|
Raster |
minusFrom(double value) Subtract a constant value from this Raster |
|
Raster |
minusFrom(java.util.List<java.lang.Double> values) Subtract a List of constant values from this Raster |
|
static Raster |
mosaic(Map options, java.util.List<Raster> rasters) Mosaic a List of Rasters into a single Raster |
|
Raster |
multiply(Raster other) Multiple this Raster with another Raster |
|
Raster |
multiply(java.util.List<java.lang.Double> values) Multiply this Raster by a List of constant values |
|
Raster |
multiply(double value) Multiply this Raster by a constant value |
|
Raster |
negative() Create a new Raster by inverting the values of this Raster. |
|
Raster |
normalize() Calculate a normalized version of the current Raster |
|
Raster |
plus(Raster other) Add this Raster with another Raster |
|
Raster |
plus(double value) Add a constant value to this Raster |
|
Raster |
plus(java.util.List<java.lang.Double> values) Add a List of constant values to this Raster |
|
void |
putAt(java.lang.Object p, java.lang.Object value) Set the value for the given Point or Pixel |
|
Raster |
reclassify(Map options, java.util.List ranges) Reclassify this Raster with a List of ranges. |
|
void |
render() Render the Raster in a simple GUI |
|
Raster |
reproject(Projection proj) Reproject this Raster to another Projection creating a new Raster |
|
Raster |
resample(Map options) Resample this Raster |
|
Raster |
scale(float x, float y, float xTrans, float yTrans, java.lang.String interpolation) Scale this Raster |
|
Raster |
selectBands(java.util.List<java.lang.Integer> bands, int visibleBand) Create a new Raster with selection of Bands |
|
void |
setProj(java.lang.Object projection) Set the Projection of this Raster (reprojecting if necessary) |
|
void |
setValue(java.lang.Object p, java.lang.Object value, int band) Set the value for the given Point or Pixel |
|
Raster |
stylize(Style sym) Create a new Raster with styling baked in. |
|
Raster |
stylize() Create a new Raster with current styling baked in. |
|
Raster |
transform(Map options) Transform this Raster using an Affine Transformation. |
|
Layer |
zonalStatistics(int band, Layer zones, Raster classification) Calculate the zonal statistics of this Raster |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
A GeoScript Raster wraps a GeoTools GridCoverage2D
The Format
The Style
Create a new Raster from a List of List of float values
data
- A List of Lists of float valuesbounds
- The geographic BoundsCreate a Raster from a GeoTools GridCoverage2D.
coverage
- The GeoTools GridCoverage2Dformat
- The FormatCreate a Raster from an Image and Bounds
image
- The imagebounds
- The BoundsCreate a new Raster by calculating the absolute value for every cell.
Add this Raster with another Raster
other
- Another a RasterAdd a constant value to this Raster
value
- The constant numberAdd a List of constant values to this Raster
values
- The List of constant numbersDetermine whether this Raster contains the geographic Point
point
- The PointDetermine whether this Raster contains the pixel coordinates
x
- The x pixel coordinatey
- The y pixel coordinateCreate contours
band
- The Raster bandintervalOrLevels
- The contour interval or a List of levelssimplify
- Whether to simplify the contourssmooth
- Whether to smooth the contoursCalculate a convoluted version of the current Raster
radius
- The kernel radiusCalculate a convoluted version of the current Raster
width
- The kernel widthheight
- The height widthCreate a shaded relief Raster from the current Raster
options
- The optional named parameters.
scale
- The scale 1 or 10000altitude
- The altitude in degrees 65azimuth
- The azimuth in degrees 75Crop this Raster
geometry
- The GeometryCrop this Raster using pixel coordinates
x1
- The x of the min pixely1
- The y of the min pixelx2
- The x of the max pixely2
- The y of the max pixelDispose of this Raster
Divide this Raster by another Raster
other
- The other RasterDivide this Raster by a constant value
value
- The constant valueDivide this Raster by a List of constant values
values
- A List of constant valuesDivide this Raster by another Raster
other
- The other RasterDivide this Raster by a constant value
value
- The constant valueDivide this Raster by a List of constant values
values
- A List of constant valuesCall the Closure for each cell in this Raster
Named
- parameters
closure
- The Closure to call which is passed the value, the pixel x, and the pixel yCall the Closure for each window of values in this Raster
options
- Named parameters
closure
- The Closure to call which is passed the values, the pixel x, and the pixel yGet the value of the Raster at the given geographic Location. If the Raster contains multiple bands a Collection of values, one for each band, will be returned.
point
- The Point where we want a value from the Rastertype
- The type of value to return (double, float, int, byte, boolean, default)Get the value of the Raster at the given pixel Location. If the Raster contains multiple bands a Collection of values, one for each band, will be returned.
x
- The pixel x coordinatey
- The pixel y coordinatetype
- The type of value to return (double, float, int, byte, boolean, default)Create a new Raster by calculating the exponential value for every cell.
Extract the foot print of this Raster as a vector Layer
options
- Optional named parameters:
Get the value of the Raster at the given geographic Location or pixel location. If the Raster contains multiple bands a Collection of values, one for each band, will be returned.
point
- The Point where we want a value from the RasterGet the List of Bands
Get the block size
Get the Bounds
Get a BufferedImage
Get the number of columns
Get the underlying java.awt.image.Raster
Calculate the min and max values for each band in this Raster.
Get a Histogram for this Raster
options
- Optional named parameters can include low, high, and numBins
Get the RenderedImage
Get the maximum value for a band. It first tries to get the value from the Band's metadata and then calculates it from the actual data.
band
- The Band indexGet the minimum value for a band. It first tries to get the value from the Band's metadata and then calculates it from the actual data.
band
- The Band indexGet the Raster's name
Get the value of the neighboring cells: NW N NE E SE S SE W
p
- The Point or Pixelband
- The band (defaults to 0)Get pixel coordinates from the geographic Point
p
- The geographic PointGet the pixel size
Get a geographic Point from pixel coordinates
x
- The x pixel coordinatey
- The y pixel coordinateConvert this Raster into a Layer of Points
options
- Optional named parameters:
Convert this Raster to a Layer of polygons.
options
- Optional named parameters may include:
Get the Projection
Get the number of rows
Get the size [w,h] or [columns,rows]
Get the value at the given geographic location (Point) or pixel location ([x,y]) for the given band
p
- The Point or Pixel (list x,y)band
- The band zero basedtype
- The type of value to return (double, float, int, byte, boolean, default)Get the value at the given pixel location ([x,y]) for the given band
x
- The pixel xy
- The pixel yband
- The band zero basedtype
- The type of value to return (double, float, int, byte, boolean, default)Get a List of values from the Raster
x
- The pixel x or col to start fromy
- The pixel y or row to start fromw
- The number of columnsh
- The number of rowsband
- The band to get values from (defaults to 0)flat
- Whether the List should be returned flat (true, the default) or with nested Lists (false)Get values as a String
options
- Optional named parameters (prettyPrint = false | true)x
- The pixel x or col to start fromy
- The pixel y or row to start fromw
- The number of columnsh
- The number of rowsband
- The band to get values from (defaults to 0)Create a new Raster by inverting the values of this Raster
Create a new Raster by calculating the log value for every cell.
Merge a List of Rasters into one Raster @return
options
- Optional named parameters:
rasters
- A List of Rasters to mergeSubtract this Raster from an other Raster
other
- The other RasterSubtract this Raster from a constant value
value
- The constant valueSubtract this Raster from a List of constant values
values
- The List of constant valuesSubtract a constant value from this Raster
value
- The constant valueSubtract a List of constant values from this Raster
values
- The List of constant valuesMosaic a List of Rasters into a single Raster
options
- options Optional named parameters:
rasters
- The List of RastersMultiple this Raster with another Raster
def r3 = r1 * r2
other
- Another a RasterMultiply this Raster by a List of constant values
values
- The list of constant valuesMultiply this Raster by a constant value
values
- The constant valueCreate a new Raster by inverting the values of this Raster. Overrides the - operator
def invertedRaster = -raster
Calculate a normalized version of the current Raster
Add this Raster with another Raster
def r3 = r1 + r2
other
- Another a RasterAdd a constant value to this Raster
value
- The constant numberAdd a List of constant values to this Raster
values
- The List of constant numbersSet the value for the given Point or Pixel
p
- The Point or Pixel (as List of xy coordinates)value
- The new valueReclassify this Raster with a List of ranges.
options
- Optional named parameters can include the band to reclassify and the noData value.
ranges
- The List of Ranges contains one or more Maps with min, max, and value keys.Render the Raster in a simple GUI
Reproject this Raster to another Projection creating a new Raster
proj
- The ProjectionResample this Raster
options
- Optional named parameters can include:
Scale this Raster
x
- The scale factor along the x axisy
- The scale factor along the y axisxTrans
- The x translationyTrans
- The y translationinterpolation
- The interpolation method (bicubic, bicubic2, bilinear, nearest)Create a new Raster with selection of Bands
bands
- The indices of the selected bandsvisibleBand
- The visible bandSet the Projection of this Raster (reprojecting if necessary)
projection
- The ProjectionSet the value for the given Point or Pixel
p
- The Point or Pixel (as List of xy coordinates)value
- The new valueband
- The band (defaults to 0)Create a new Raster with styling baked in.
style
- The Style/SymobolizerCreate a new Raster with current styling baked in.
Transform this Raster using an Affine Transformation.
options
- The named parameters
Calculate the zonal statistics of this Raster
band
- The bandzones
- A Layer of polygons representing the zonesclassification
- An optional Raster whose values are used as classesGroovy Documentation