|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.moseph.gis.raster.Raster
public class Raster
Represents my best guess at the ESRI ASCII raster format. I couldn't find any sensible documentation, so it supports the following features:
Field Summary | |
---|---|
protected double |
cellsize
|
protected int |
cols
|
protected double[][] |
data
|
static java.lang.String |
DEFAULT_NODATA
|
protected java.lang.String |
NDATA
|
protected int |
rows
|
protected double |
xll
|
protected double |
yll
|
Constructor Summary | |
---|---|
Raster()
Creates an empty raster |
|
Raster(double[][] data,
double cellsize,
double xll,
double yll)
Creates a raster from the given data |
|
Raster(double cellsize,
double xll,
double yll)
Creates a raster from the given data |
|
Raster(int[][] data,
double cellsize,
double xll,
double yll)
Creates a raster from the given data |
Method Summary | |
---|---|
double |
getCellsize()
|
int |
getCols()
|
double[][] |
getData()
Returns the underlying data array - NOTE: this is *NOT* a copy, if you change it, you change the data |
java.lang.String |
getNDATA()
|
int |
getRows()
|
static Raster |
getTempRaster(double[][] data,
double xll,
double yll,
double size)
|
static Raster |
getTempRaster(double[][] data,
double xll,
double yll,
double size,
java.lang.String ndata)
|
double |
getValue(int row,
int column)
|
double |
getXll()
|
double |
getYll()
|
void |
init(Raster other)
Sets the parameters of this raster (rows, columns, corner, cellsize, NDATA etc) to be the same as the other raster. |
void |
initData()
Initialises the Raster to Double.NaN (i.e. |
void |
initData(double value)
Initialises the raster so the entire data array contains 'value' |
void |
print()
|
void |
setCellsize(double cellsize)
|
void |
setData(double[][] data)
Copies the given data into the underlying data array. |
void |
setData(int[][] data)
Copies the given data into the underlying data array. |
void |
setNDATA(java.lang.String nDATA)
|
void |
setSize(int nrows,
int columns)
Sets the size of the raster, and also initialises the array with NDATA |
void |
setValue(int row,
int column,
double value)
|
void |
setXll(double xll)
|
void |
setYll(double yll)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double[][] data
protected double xll
protected double yll
protected double cellsize
protected int cols
protected int rows
protected java.lang.String NDATA
public static final java.lang.String DEFAULT_NODATA
Constructor Detail |
---|
public Raster()
public Raster(double cellsize, double xll, double yll)
cellsize
- xll
- yll
- public Raster(double[][] data, double cellsize, double xll, double yll)
data
- cellsize
- xll
- yll
- public Raster(int[][] data, double cellsize, double xll, double yll)
data
- cellsize
- xll
- yll
- Method Detail |
---|
public void print()
public static Raster getTempRaster(double[][] data, double xll, double yll, double size)
public static Raster getTempRaster(double[][] data, double xll, double yll, double size, java.lang.String ndata)
public void init(Raster other)
other
- public void initData()
public void initData(double value)
value
- public double[][] getData()
public void setValue(int row, int column, double value)
public double getValue(int row, int column)
public void setData(double[][] data)
data
- public void setData(int[][] data)
data
- public double getXll()
public void setXll(double xll)
public double getYll()
public void setYll(double yll)
public double getCellsize()
public void setCellsize(double cellsize)
public int getCols()
public int getRows()
public void setSize(int nrows, int columns)
nrows
- columns
- public java.lang.String getNDATA()
public void setNDATA(java.lang.String nDATA)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |