public class Raster extends Object
| Constructor and Description |
|---|
Raster(org.geotools.coverage.grid.GridCoverage2D raster)
Create a raster for reading purposes.
|
Raster(org.geotools.coverage.grid.GridCoverage2D raster,
boolean makeNew)
Create a new raster using a given raster as template.
|
Raster(int cols,
int rows,
double res,
double ulEasting,
double ulNorthing,
String epsg)
Create a new raster based on the region properties.
|
Raster(Raster raster)
Create a new raster using a given raster as template.
|
| Modifier and Type | Method and Description |
|---|---|
org.geotools.coverage.grid.GridCoverage2D |
buildRaster()
Creates a
GridCoverage2D from the Raster. |
int |
getCols() |
org.opengis.referencing.crs.CoordinateReferenceSystem |
getCrs() |
double |
getEast() |
org.geotools.coverage.grid.GridGeometry2D |
getGridGeometry() |
double |
getNorth() |
double |
getRes() |
int |
getRows() |
double |
getSouth() |
double |
getWest() |
double |
getxRes() |
double |
getyRes() |
int[] |
gridAt(double x,
double y)
Get grid col and row from a world coordinate.
|
boolean |
isNoValue(double value) |
double |
novalue() |
double[] |
positionAt(int col,
int row)
Get world position from col, row.
|
static Raster |
read(String path)
Read a raster from file.
|
void |
setValueAt(int col,
int row,
double value)
Sets a raster value if the raster is writable.
|
double[] |
surrounding(int col,
int row)
Get the values of the surrounding cells.
|
double |
valueAt(int col,
int row)
Get the raster value at a given col/row.
|
static boolean |
valuesEqual(double value1,
double value2) |
void |
write(String path)
Write the raster to file.
|
public Raster(org.geotools.coverage.grid.GridCoverage2D raster)
raster - the raster to access.public Raster(org.geotools.coverage.grid.GridCoverage2D raster,
boolean makeNew)
coverage - makeNew - public Raster(Raster raster)
raster - the raster to copy the properties from.public Raster(int cols,
int rows,
double res,
double ulEasting,
double ulNorthing,
String epsg)
cols - rows - res - ulEasting - ulNorthing - epsg - public int getRows()
public int getCols()
public double getNorth()
public double getSouth()
public double getWest()
public double getEast()
public double getxRes()
public double getyRes()
public double getRes()
public org.opengis.referencing.crs.CoordinateReferenceSystem getCrs()
public double valueAt(int col,
int row)
col - row - public double[] positionAt(int col,
int row)
col - row - null if outside the bounds.public int[] gridAt(double x,
double y)
x - y - null if the position is outside the bounds.public void setValueAt(int col,
int row,
double value)
col - row - value - public double[] surrounding(int col,
int row)
col - the col of the center cell.row - the row of the center cell.public boolean isNoValue(double value)
public double novalue()
public static boolean valuesEqual(double value1,
double value2)
public org.geotools.coverage.grid.GridGeometry2D getGridGeometry()
public org.geotools.coverage.grid.GridCoverage2D buildRaster()
GridCoverage2D from the Raster.public void write(String path) throws Exception
path - th epath to write to.ExceptionCopyright © 2005–2020 HydroloGIS. All rights reserved.