public class GridData extends Object
| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
GridData.Byte |
GridData.Integer class
|
static class |
GridData.Double |
GridData.Double class
|
static class |
GridData.Float |
GridData.Integer class
|
static class |
GridData.Integer |
GridData.Integer class
|
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
double[][] |
data |
Grid data
|
String |
fieldName |
|
double |
missingValue |
|
ProjectionInfo |
projInfo |
Projection information
|
double[] |
xArray |
|
double[] |
yArray |
| 构造器 | 说明 |
|---|---|
GridData() |
Constructor
|
GridData(double xStart,
double xDelt,
int xNum,
double yStart,
double yDelt,
int yNum) |
Constructor
|
GridData(GridData aGridData) |
Constructor
|
GridData(Array array,
List<Number> xdata,
List<Number> ydata,
double missingValue,
ProjectionInfo projInfo) |
Constructor
|
GridData(Array array,
Array xdata,
Array ydata) |
Constructor
|
GridData(Array array,
Array xdata,
Array ydata,
Number missingValue) |
Constructor
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
GridData |
abs() |
Calculate abstract grid data
|
GridData |
acos() |
Calculate anti-cosine grid data
|
GridData |
add(double value) |
Add operation with a double value
|
GridData |
add(GridData bGrid) |
Add operation with another grid data
|
void |
aggregate(GridData toGridData,
boolean isAverage) |
Aggregate the grid data to coarser resolution
|
GridData |
asin() |
Calculate anti-sine grid data
|
GridData |
atan() |
Calculate anti-tangent grid data
|
double |
average() |
Calculate average value
|
double[] |
average(GridData bGrid,
double[] tValues) |
Calculate average data array by another grid data and threshold values
|
Object |
clone() |
Clone
|
GridData |
cos() |
Calculate cosine grid data
|
GridData |
div(double value) |
Divide operation with a double value
|
GridData |
div(GridData bGrid) |
Divide operation with another grid data
|
GridData |
exp() |
Calculate e raised specific power value of grid data
|
void |
extendToGlobal() |
Extend the grid data to global by add a new column data
|
GridData |
extract(double sX,
double eX,
double sY,
double eY) |
Extract grid data by extent
|
GridData |
extract(int sXIdx,
int sYIdx,
int xNum,
int yNum) |
Extract grid data by extent index
|
GridData |
extract(int sXIdx,
int eXIdx,
int xstep,
int sYIdx,
int eYIdx,
int ystep) |
Extract grid data by extent index
|
GridData |
extract(Extent extent) |
Extract grid data by extent
|
void |
gassianToLatLon() |
Convert Gassian grid to lat/lon grid
|
void |
GassianToLatLon_Simple() |
Convert Gassian grid to lat/lon grid - only convert Y coordinate
|
Array |
getArray() |
Get array from data
|
double |
getBorderXMax() |
Get maximum x of the grid border
|
double |
getBorderXMin() |
Get minimum x of the grid border
|
double |
getBorderYMax() |
Get maximum y of the grid border
|
double |
getBorderYMin() |
Get minimum y of the grid border
|
List<Dimension> |
getDimensions() |
Get dimensions
|
double |
getDoubleValue(int i,
int j) |
Get double value
|
Extent |
getExtent() |
Get Extent
|
GridDataSetting |
getGridDataSetting() |
Get grid data setting
|
int[] |
getIJIndex(double x,
double y) |
Get i/j index of a point in the grid
|
double[] |
getMaxMinValue() |
Get maximum and minimum values
|
boolean |
getMaxMinValue(double[] maxmin) |
Get maximum and minimum values
|
double |
getMaxValue() |
Get maximum value
|
double |
getMinValue() |
Get minimum value
|
List<Number> |
getUniqueValues() |
Get unique values
|
double |
getValue(double x,
double y) |
Get a cell value by X/Y coordinate - nearest cell
|
Number |
getValue(int i,
int j) |
Get value
|
double |
getXDelt() |
Get xArray delt
|
double |
getXMax() |
Get maximum x
|
double |
getXMin() |
Get minimum x
|
int |
getXNum() |
Get xArray number
|
double |
getYDelt() |
Get yArray delt
|
double |
getYMax() |
Get maximum y
|
double |
getYMin() |
Get minimum y
|
int |
getYNum() |
Get yArray number
|
boolean |
hasMissing() |
Get if has missing value
|
boolean |
hasNaN() |
Get if has NaN value
|
GridData |
interpolate() |
Interpolate grid data
|
GridData |
interpolate_old() |
Interpolate grid data
|
double[][] |
interpolation_Grid(double[][] GridData,
double[] X,
double[] Y,
double unDefData,
double[] nX,
double[] nY) |
Interpolate from grid data
|
boolean |
isGlobal() |
Get if the data is global
|
boolean |
isXStagger() |
Get if is x stagger
|
boolean |
isYStagger() |
Get if is y stagger
|
GridData |
log() |
Calculate logrithm grid data
|
GridData |
log10() |
Calculate base 10 logrithm grid data
|
GridData |
maskout(List<PolygonShape> polygons) |
Mask out grid data with polygon shapes
|
GridData |
maskout(GridData maskGrid) |
Mask out grid data by a mask grid data
|
GridData |
maskout(VectorLayer maskLayer) |
Mask out grid data with a polygon layer
|
GridData |
maskout(PolygonShape aPGS) |
Mask out grid data with a polygon shape
|
GridData |
max(GridData bGrid) |
Maximum operation with another grid data
|
GridData |
merge(GridData bGrid) |
Merge grid values by anthor grid data - the two grids should have same
extent replace missing value with valid data
|
GridData |
min(GridData bGrid) |
Minimum operation with another grid data
|
GridData |
mul(double value) |
Multiply operation with a double value
|
GridData |
mul(GridData bGrid) |
Multiply operation with another grid data
|
GridData |
pow(double p) |
Calculate power grid data
|
GridData |
project(ProjectionInfo toProj) |
Project grid data
|
GridData |
project(ProjectionInfo toProj,
double[] newX,
double[] newY) |
Project grid data
|
GridData |
project(ProjectionInfo toProj,
double[] newX,
double[] newY,
ResampleMethods resampleMethod) |
Project grid data
|
GridData |
project(ProjectionInfo fromProj,
ProjectionInfo toProj) |
Project grid data
|
GridData |
project(ProjectionInfo fromProj,
ProjectionInfo toProj,
double[] newX,
double[] newY,
ResampleMethods resampleMethod) |
Project grid data
|
StationData |
project(ProjectionInfo fromProj,
ProjectionInfo toProj,
StationData stData,
ResampleMethods resampleMethod) |
Project grid data to station data
|
GridData |
project(ProjectionInfo fromProj,
ProjectionInfo toProj,
ResampleMethods resampleMethod) |
Project grid data
|
void |
regrid(GridData gridData) |
Regrid data with double linear interpolation method
|
void |
replaceValue(double aValue,
double bValue) |
Replace a certain grid data value by a new value
|
void |
replaceValue(double aValue,
double bValue,
boolean bigger) |
Replace grid data value by a threshold - the values bigger/smaller than
the threshold value will be replaced by the new value
|
GridData |
resample(GridData toGridData,
ResampleMethods method) |
Resample grid data
|
void |
saveAsBILFile(String fileName) |
Save as BIL data file
|
void |
saveAsESRIASCIIFile(String aFile) |
Save as ESRI ASCII data file
|
void |
saveAsStationData(String filePath,
String fieldName) |
Save as station data file
|
void |
saveAsSurferASCIIFile(String aFile) |
Save as Surfer ASCII data file
|
void |
setMissingValue(double value,
boolean isBigger) |
Set missing value - bigger or smaller than the given value
|
GridData |
setValue(double aValue) |
Set constant value to all grid cells
|
GridData |
setValue(GridData bGrid) |
Set grid values by anthor grid data - overlay
|
GridData |
setValue(GridData bGrid,
boolean useMissingData) |
Set grid values by anthor grid data - overlay
|
void |
setXStagger(boolean value) |
Set if is x stagger
|
void |
setYStagger(boolean value) |
Set if is y stagger
|
GridData |
sin() |
Calculate sine grid data
|
GridData |
skip(int skipI,
int skipJ) |
Skip the grid data by two dimension skip factor
|
GridData |
sqrt() |
Calculate square root grid data
|
double[] |
statistics() |
Simple statistics of the grid data
|
GridData |
sub(double value) |
Subtraction operation with a double value
|
GridData |
sub(GridData bGrid) |
Subtraction operation with another grid data
|
double |
sum() |
Calculate summary value
|
GridData |
tan() |
Calculate tangent grid data
|
boolean |
testUniqueValues() |
Test unique values
|
GridArray |
toGridArray() |
Convert to GridArray object
|
double |
toStation(double x,
double y) |
Interpolate grid data to a station point
|
void |
toStation(String inFile,
String outFile) |
Interpolate grid data to stations imported from station file
|
List<Double> |
toStation(List<Number> xlist,
List<Number> ylist) |
Interpolate grid data to station points
|
StationData |
toStation(StationData stData) |
Interpolate grid data to station data
|
void |
toStation(StationTableData stData) |
Interpolate grid data to station data
|
double |
toStation_Gaussian(double x,
double y) |
Interpolate grid data to a station point
|
GridData |
unStagger_X() |
Un stag grid data through x dimension
|
GridData |
unStagger_Y() |
Un stag grid data through y dimension
|
void |
xReverse() |
xArray reverse to the grid data
|
void |
yReverse() |
yArray reverse to the grid data
|
public double[][] data
public double[] xArray
public double[] yArray
public double missingValue
public ProjectionInfo projInfo
public String fieldName
public GridData()
public GridData(GridData aGridData)
aGridData - The grid datapublic GridData(double xStart,
double xDelt,
int xNum,
double yStart,
double yDelt,
int yNum)
xStart - xArray startxDelt - xArray deltxNum - xArray numberyStart - yArray startyDelt - yArray deltyNum - yArray numberpublic GridData(Array array, List<Number> xdata, List<Number> ydata, double missingValue, ProjectionInfo projInfo)
array - Data arrayxdata - X dataydata - Y datamissingValue - Missing valueprojInfo - Projection infopublic GridData(Array array, Array xdata, Array ydata)
array - Data arrayxdata - X dataydata - Y datapublic int getXNum()
public int getYNum()
public double getXDelt()
public double getYDelt()
public Extent getExtent()
public boolean isGlobal()
public boolean isXStagger()
public void setXStagger(boolean value)
value - Booleanpublic boolean isYStagger()
public void setYStagger(boolean value)
value - Booleanpublic Number getValue(int i, int j)
i - I indexj - J indexpublic double getDoubleValue(int i,
int j)
i - I indexj - J indexpublic GridData add(GridData bGrid)
bGrid - The grid datapublic GridData add(double value)
value - Double valuepublic GridData sub(GridData bGrid)
bGrid - The grid datapublic GridData sub(double value)
value - The double valuepublic GridData mul(GridData bGrid)
bGrid - The grid datapublic GridData mul(double value)
value - Double valuepublic GridData div(GridData bGrid)
bGrid - The grid datapublic GridData div(double value)
value - Double valuepublic void regrid(GridData gridData)
gridData - Result grid datapublic double toStation(double x,
double y)
x - X coordinate of the stationy - Y coordinate of the stationpublic List<Double> toStation(List<Number> xlist, List<Number> ylist)
xlist - X coordinate listylist - Y coordinate listpublic StationData toStation(StationData stData)
stData - Station datapublic void toStation(StationTableData stData)
stData - Station table datapublic void toStation(String inFile, String outFile) throws UnsupportedEncodingException, FileNotFoundException, IOException
inFile - Input station fileoutFile - Output station fileUnsupportedEncodingExceptionFileNotFoundExceptionIOExceptionpublic GridData setValue(GridData bGrid)
bGrid - The grid datapublic GridData setValue(GridData bGrid, boolean useMissingData)
bGrid - The grid datauseMissingData - if set missing datapublic GridData setValue(double aValue)
aValue - The valuepublic void replaceValue(double aValue,
double bValue)
aValue - Old valuebValue - New valuepublic void replaceValue(double aValue,
double bValue,
boolean bigger)
aValue - Threshold valuebValue - New valuebigger - Bigger or smallerpublic GridData merge(GridData bGrid)
bGrid - The grid datapublic GridData max(GridData bGrid)
bGrid - The grid datapublic GridData min(GridData bGrid)
bGrid - The grid datapublic double sum()
public double average()
public double[] average(GridData bGrid, double[] tValues)
bGrid - The grid datatValues - Threshold valuespublic double[] statistics()
public GridData abs()
public GridData acos()
public GridData asin()
public GridData atan()
public GridData cos()
public GridData sin()
public GridData tan()
public GridData exp()
public GridData pow(double p)
p - Power valuepublic GridData sqrt()
public GridData log()
public GridData log10()
public void extendToGlobal()
public Array getArray()
public GridData extract(Extent extent)
extent - Extentpublic GridData extract(double sX, double eX, double sY, double eY)
sX - Start XeX - End XsY - Start YeY - End Ypublic GridData extract(int sXIdx, int sYIdx, int xNum, int yNum)
sXIdx - Start x indexsYIdx - Start y indexxNum - X numberyNum - Y numberpublic GridData extract(int sXIdx, int eXIdx, int xstep, int sYIdx, int eYIdx, int ystep)
sXIdx - Start x indexeXIdx - End x indexxstep - X stepsYIdx - Start y indexeYIdx - End y indexystep - Y steppublic void setMissingValue(double value,
boolean isBigger)
value - The given valueisBigger - Is bigger or notpublic GridData skip(int skipI, int skipJ)
skipI - Skip number in x coordinateskipJ - Skip number in y coordinatepublic double getValue(double x,
double y)
x - X coordinatey - Y coordinatepublic double toStation_Gaussian(double x,
double y)
x - X coordinate of the stationy - Y coordinate of the stationpublic void gassianToLatLon()
public void GassianToLatLon_Simple()
public double getXMin()
public double getXMax()
public double getYMin()
public double getYMax()
public double getBorderXMin()
public double getBorderXMax()
public double getBorderYMin()
public double getBorderYMax()
public int[] getIJIndex(double x,
double y)
x - The x coordinatey - The y coordinatepublic void saveAsSurferASCIIFile(String aFile)
aFile - File pathpublic void saveAsESRIASCIIFile(String aFile)
aFile - File pathpublic void saveAsBILFile(String fileName) throws IOException
fileName - File pathIOExceptionpublic void saveAsStationData(String filePath, String fieldName)
filePath - File PathfieldName - Field namepublic boolean getMaxMinValue(double[] maxmin)
maxmin - Max/Min arraypublic boolean hasMissing()
public boolean hasNaN()
public double[] getMaxMinValue()
public double getMaxValue()
public double getMinValue()
public boolean testUniqueValues()
public GridDataSetting getGridDataSetting()
public GridData maskout(PolygonShape aPGS)
aPGS - The polygon shapepublic GridData maskout(List<PolygonShape> polygons)
polygons - The polygon shapespublic GridData maskout(VectorLayer maskLayer)
maskLayer - The polygon layerpublic GridData maskout(GridData maskGrid)
maskGrid - Mask grid datapublic GridData resample(GridData toGridData, ResampleMethods method)
toGridData - The grid datamethod - The resample methodpublic GridData interpolate()
public double[][] interpolation_Grid(double[][] GridData,
double[] X,
double[] Y,
double unDefData,
double[] nX,
double[] nY)
GridData - input grid dataX - input x coordinatesY - input y coordinatesunDefData - undefine datanX - output x coordinatenY - output y coordinatepublic GridData interpolate_old()
public GridData project(ProjectionInfo toProj)
toProj - To projectionpublic GridData project(ProjectionInfo fromProj, ProjectionInfo toProj)
fromProj - From projectiontoProj - To projectionpublic GridData project(ProjectionInfo fromProj, ProjectionInfo toProj, ResampleMethods resampleMethod)
fromProj - From projectiontoProj - To projectionresampleMethod - Interpolation methodpublic GridData project(ProjectionInfo toProj, double[] newX, double[] newY)
toProj - To projection infonewX - New xArray coordinatesnewY - New yArray coordinatespublic GridData project(ProjectionInfo toProj, double[] newX, double[] newY, ResampleMethods resampleMethod)
toProj - To projection infonewX - New xArray coordinatesnewY - New yArray coordinatesresampleMethod - Interpolation methodpublic GridData project(ProjectionInfo fromProj, ProjectionInfo toProj, double[] newX, double[] newY, ResampleMethods resampleMethod)
fromProj - From projection infotoProj - To projection infonewX - New xArray coordinatesnewY - New yArray coordinatesresampleMethod - Interpolation methodpublic StationData project(ProjectionInfo fromProj, ProjectionInfo toProj, StationData stData, ResampleMethods resampleMethod)
fromProj - From projection infotoProj - To projection infostData - Station dataresampleMethod - Interpolation methodpublic void aggregate(GridData toGridData, boolean isAverage)
toGridData - To grid dataisAverage - If is averagepublic GridData unStagger_X()
public GridData unStagger_Y()
public void yReverse()
public void xReverse()
public GridArray toGridArray()
Copyright © 2019. All rights reserved.