public class AscRaster extends Object
| Modifier and Type | Field and Description |
|---|---|
protected double |
cellsize |
protected int |
cols |
protected double[][] |
data |
static String |
DEFAULT_NODATA |
protected double |
dx |
protected double |
dy |
protected String |
NDATA |
protected int |
rows |
protected double |
xll |
protected double |
yll |
| Constructor and Description |
|---|
AscRaster()
Creates an empty raster
|
AscRaster(double[][] data,
double cellsize,
double dx,
double dy,
double xll,
double yll)
Creates a raster from the given data
|
AscRaster(double cellsize,
double dx,
double dy,
double xll,
double yll)
Creates a raster from the given data
|
AscRaster(int[][] data,
double cellsize,
double dx,
double dy,
double xll,
double yll)
Creates a raster from the given data
|
| Modifier and Type | Method and Description |
|---|---|
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
|
double |
getdx() |
double |
getdy() |
double[][] |
getInvertedAxisData() |
String |
getNDATA() |
int |
getRows() |
static AscRaster |
getTempRaster(double[][] data,
double xll,
double yll,
double size) |
static AscRaster |
getTempRaster(double[][] data,
double xll,
double yll,
double size,
String ndata) |
double |
getValue(int row,
int column) |
double |
getXll() |
double |
getYll() |
void |
init(AscRaster 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'
|
int |
latitude2Index(double latitude) |
int |
longitude2Index(double longitude) |
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 |
setdx(double dx) |
void |
setdy(double dy) |
void |
setNDATA(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) |
protected double[][] data
protected double xll
protected double yll
protected double cellsize
protected double dx
protected double dy
protected int cols
protected int rows
public static final String DEFAULT_NODATA
protected String NDATA
public AscRaster()
public AscRaster(double cellsize,
double dx,
double dy,
double xll,
double yll)
cellsize - xll - yll - public AscRaster(double[][] data,
double cellsize,
double dx,
double dy,
double xll,
double yll)
data - cellsize - xll - yll - public AscRaster(int[][] data,
double cellsize,
double dx,
double dy,
double xll,
double yll)
data - cellsize - xll - yll - public void print()
public static AscRaster getTempRaster(double[][] data, double xll, double yll, double size)
public static AscRaster getTempRaster(double[][] data, double xll, double yll, double size, String ndata)
public void init(AscRaster other)
other - public void initData()
public void initData(double value)
value - public double[][] getData()
public double[][] getInvertedAxisData()
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 double getdx()
public void setdx(double dx)
public double getdy()
public void setdy(double dy)
public int getCols()
public int getRows()
public void setSize(int nrows,
int columns)
nrows - columns - public String getNDATA()
public void setNDATA(String nDATA)
public int longitude2Index(double longitude)
public int latitude2Index(double latitude)
Copyright © 2021. All Rights Reserved.