|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jwo.landserf.structure.SpatialObject jwo.landserf.structure.RasterMap
Models a GIS raster map. Stores the raster resolution and dimensions, raster values, shaded relief sun angles and colour table. Other information in common with all other spatial objects is stored in the Header class.
Header
,
Serialized FormField Summary | |
static int |
ASPECT
Aspect. |
static int |
CENTRE_RES
Central residual. |
static int |
CROSC
Cross-sectional curvature. |
static int |
ELEV
Elevation. |
static int |
FEATURE
Surface feature. |
static int |
FIRST_PARAM
First parameter in list. |
static int |
FUZZY
Fuzzy membership. |
static int |
IMAGE
Image (raster cells represent colours). |
static int |
LAST_PARAM
Last parameter in list. |
static int |
LONGC
Longitudinal curvature. |
static int |
MAXIC
Maximum curvature. |
static int |
MEAN_RES
Mean residual. |
static int |
MEANC
Mean curvature. |
static int |
MINIC
Minimum curvature. |
static int |
NETWORK_FEATURE
Surface feature network. |
static int |
OTHER
Other raster type. |
static int |
PLANC
Plan curvature. |
static int |
PROFC
Profile curvature. |
static int |
RELIEF
Shaded relief. |
static int |
SLOPE
Slope. |
Fields inherited from interface jwo.landserf.structure.SpatialModel |
ADJACENT, AREA, CONTOUR, ENCLOSES, INTERSECTION, LINE, MATCHES, MSN, NO_VALUE, OUT_OF_BOUNDS, OVERLAPS, POINT, RASTER_2D, RASTER_3D, SEPARATE, TIN, UNDEFINED, UNION, UNKNOWN_MODEL, VECTOR_2D, VECTOR_3D, VOLUME, WITHIN |
Constructor Summary | |
RasterMap()
Creates a blank raster with a single cell. |
|
RasterMap(int numRows,
int numCols)
Creates a blank raster with a the given number of rows and columns. |
|
RasterMap(int numRows,
int numCols,
Footprint fp)
Creates a raster map with the given dimensions. |
|
RasterMap(int numRows,
int numCols,
Footprint fp,
Header header)
Creates a raster map with the given dimensions. |
|
RasterMap(RasterMap oldRaster)
Creates a raster map based on the attributes of the given one. |
|
RasterMap(RasterMap oldRaster,
int nRows,
int nCols)
Creates a raster map based on the attributes of the given one, but re-interpolated to the given resolution. |
|
RasterMap(VectorMap vectorMap)
Creates a raster map based on the spatial extent of the given vector map. |
Method Summary | |
int |
calcBorder()
Reports the estimated size of the border around raster. |
Object |
clone()
Clones this raster map. |
float |
getAspectWeight()
Returns the currently selected aspect bias. |
float |
getAttribute(float easting,
float northing)
Reports the attribute of the raster at the given location. |
float |
getAttribute(Footprint fp)
Reports the attribute of the raster at the given location. |
float |
getAttribute(int row,
int col)
Reports the attribute of the raster at the given array coordinates. |
float |
getAzimAngle()
Returns the sun azimuthal angle. |
void |
getBlendImage(int[] img,
int imgWidth,
RasterMap drape)
Creates a blended image from this and the secondary raster. |
int |
getCol(float x)
Returns the raster column corresponding to a given easting. |
int |
getCol(float x,
boolean ignoreBounds)
Returns the raster column corresponding to a given easting. |
float |
getCurveTol()
Returns the currently selected curvature tolerance for feature extraction. |
float |
getDecayExp()
Returns the currently selected local window distance decay exponent. |
float |
getDiffuse()
Returns the diffuse constant used in surface for relief calculation. |
float |
getElevAngle()
Returns the sun elevation angle. |
Footprint |
getFootprint(float row,
float col)
Reports the footprint associated with a given row and column value in the raster. |
int[] |
getFrequencyDist(float width)
Returns frequency distribution of the raster based on the raster's minimum and maximum values and given bin width. |
int[] |
getFrequencyDist(float min,
float max,
float width)
Returns frequency distribution of the raster based on the given minimum,maximum and bin width. |
int[] |
getFrequencyDist(float min,
float max,
float width,
boolean ignore,
float ignoreVal)
Returns frequency distribution of the raster based on the given minimum,maximum and bin width. |
int[] |
getHammockDist(int m)
Returns a modulus frequency distribution (hammock distribution) of the raster. |
int[] |
getHammockDist(int m,
float ignoreVal)
Returns a modulus frequency distribution (hammock distribution) of the raster ignoring given value. |
void |
getHueSatImage(int[] img,
int imgWidth,
RasterMap drape)
Creates a combined 'hue-saturation' image from this and another raster. |
void |
getImage(int[] img,
int imgWidth)
Converts raster into colour image for display. |
float |
getMaxAttribute()
Reports the maximimum attribute value of the raster. |
float |
getMinAttribute()
Reports the minimum attribute value of the raster. |
int |
getNumCols()
Reports the number of columns in the raster. |
int |
getNumRows()
Reports the number of rows in the raster. |
float |
getpBlend()
Returns the currently selected weighting for this surface when image blending. |
float |
getpShade()
Returns the weighting given to shaded relief. |
float[][] |
getRasterArray()
Returns the array representing the raster map. |
int |
getRasterType()
Identifies the type of information stored in this raster map. |
int |
getRow(float y)
Returns the raster row corresponding to a given northing. |
int |
getRow(float y,
boolean ignoreBounds)
Returns the raster row corresponding to a given northing. |
float |
getShadeExaggeration()
Returns the currently vertical exaggeration used for calculating relief. |
void |
getShadeImage(int[] img,
int imgWidth,
RasterMap drape)
Converts raster into shaded relief image for display. |
float |
getShine()
Returns the 'shininess' of the surface for relief calculation. |
float |
getSlopeTol()
Returns the currently selected slope tolerance for feature extraction. |
float |
getSpecular()
Returns the specular constant used in surface for relief calculation. |
int |
getType()
Reports the type of spatial object which will always be RASTER_2D in this case. |
float[][] |
getWindow(int row,
int col,
int wSize)
Returns a local window from the raster. |
int |
getWSize()
Returns the currently selected local window size. |
float |
getXRes()
Returns the resolution in the x direction. |
float |
getYRes()
Returns the resolution in the y direction. |
float |
interpolateAttribute(float easting,
float northing)
Interpolates the attribute of the raster at the given coordinates. |
float |
interpolateAttribute(Footprint fp)
Interpolates the attribute of the raster at the given coordinates. |
boolean |
readFile(String fileName)
Reads the contents of the given native format file into this raster object. |
void |
reset(int numRows,
int numCols,
float xRes,
float yRes)
Resets the raster with a new empty array of given size and resoluton. |
void |
setAspectWeight(float aspectWeight)
Sets the aspect bias. |
void |
setAttribute(Footprint fp,
float attribute)
Sets the attribute of the raster at the given georeferenced coordinates. |
void |
setAttribute(int row,
int col,
float attribute)
Sets the attribute of the raster at the given array coordinates. |
void |
setAttributes(float[][] rastArray)
Sets the attributes of the raster map to those dedined in the given array. |
void |
setAzimAngle(float azim)
Sets the sun azimuthal angle. |
void |
setColourTable(ColourTable cTable)
Sets the colour table assocaited with this raster. |
void |
setCurveTol(float ct)
Sets a new curvature tolerance for feature extraction. |
void |
setDecayExp(float de)
Sets a new local window distance decay exponent. |
void |
setDefaultColours()
Sets up a default colour scheme based on the range of values in this raster. |
void |
setDiffuse(float diffuse)
Sets the diffuse constant used in surface for relief calculation. |
void |
setElevAngle(float elev)
Sets the sun elevation angle. |
void |
setpBlend(float p)
Sets the weighting for given to this surface when blending with another. |
void |
setpShade(float pShade)
Sets the weighting given to shaded relief. |
void |
setRasterType(int rasterType)
Sets the type of raster stored (ELEV, SLOPE, OTHER etc). |
void |
setShadeExaggeration(float zScale)
Sets the vertical exaggeration used for calculating relief. |
void |
setShine(float shine)
Sets the 'shininess' of the surface for relief calculation. |
void |
setSlopeTol(float st)
Sets a new slope tolerance for feature extraction. |
void |
setSpecular(float specular)
Sets the specular constant used in surface for relief calculation. |
void |
setWSize(int ws)
Sets a new local window size. |
boolean |
setXRes(float xRes)
Sets the raster x resolution and checks it is consistent with the number of columns and outer boundaries. |
boolean |
setYRes(float yRes)
Sets the raster y resolution and checks it is consistent with the number of rows and outer boundaries. |
SpatialModel |
subset(Footprint fp)
Creates a subset of this raster using the intersection with the given footprint. |
String |
toString()
Reports the details of this raster map.. |
void |
updateBounds()
Does a recalculation of the attribute bounds (min and max values). |
boolean |
writeFile(String fileName,
int fileType,
GISFrame gisFrame)
Writes the contents of the raster and supplementary information to one or more files. |
boolean |
writeFile(String fileName,
int fileType,
GISFrame gisFrame,
LSThread lsThread)
Writes the contents of the raster and supplementary information to one or more files. |
Methods inherited from class jwo.landserf.structure.SpatialObject |
compare, getAttributeTable, getBounds, getColourTable, getComparisonText, getHeader, getIntersectionMER, getProjection, getUnionMER, move, setAttributeTable, setBounds, setHeader, setProjection |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ELEV
public static final int SLOPE
public static final int ASPECT
public static final int PROFC
public static final int PLANC
public static final int CROSC
public static final int LONGC
public static final int MINIC
public static final int MAXIC
public static final int MEANC
public static final int FEATURE
public static final int NETWORK_FEATURE
public static final int CENTRE_RES
public static final int MEAN_RES
public static final int RELIEF
public static final int IMAGE
public static final int FUZZY
public static final int OTHER
public static final int FIRST_PARAM
public static final int LAST_PARAM
Constructor Detail |
public RasterMap()
public RasterMap(int numRows, int numCols)
numRows
- Number of rows in raster.numCols
- Number of columns in raster.public RasterMap(int numRows, int numCols, Footprint fp)
numRows
- Number of rows in raster.numCols
- Number of columns in raster.fp
- Location and size of bottom left pixel of raster.public RasterMap(int numRows, int numCols, Footprint fp, Header header)
numRows
- Number of rows in raster.numCols
- Number of columns in raster.fp
- Location and size of bottom left pixel of raster.header
- Header associated with this raster.public RasterMap(RasterMap oldRaster)
oldRaster
- Raster map to copy.public RasterMap(RasterMap oldRaster, int nRows, int nCols)
oldRaster
- Raster map to copy.nRows
- Number of rows in the new raster.nCols
- Number of columns in the new raster.public RasterMap(VectorMap vectorMap)
vectorMap
- Vector map to copyMethod Detail |
public Object clone()
public void reset(int numRows, int numCols, float xRes, float yRes)
numRows
- Number of rows.numCols
- Number of columns.xRes
- Resolution in x direction.yRes
- Resolution in y direction.public void setDefaultColours()
public void setColourTable(ColourTable cTable)
setColourTable
in class SpatialObject
cTable
- New colour table to associate with this objectpublic SpatialModel subset(Footprint fp)
subset
in interface SpatialModel
subset
in class SpatialObject
fp
- Footprint defining subset.
public void getImage(int[] img, int imgWidth)
getImage
in interface SpatialModel
getImage
in class SpatialObject
img
- Image array to store colours.imgWidth
- Image width.public void getShadeImage(int[] img, int imgWidth, RasterMap drape)
img
- Image array to store colours.imgWidth
- Image width.drape
- Raster to drape over surface.public void getBlendImage(int[] img, int imgWidth, RasterMap drape)
img
- Image array to store colours.drape
- Secondary raster holding the hue value to combine with this one.public void getHueSatImage(int[] img, int imgWidth, RasterMap drape)
img
- Image array to store colours.drape
- Raster holding the hue value to combine.public int[] getFrequencyDist(float width)
width
- Bin width of frequency distribution.
public int[] getFrequencyDist(float min, float max, float width)
min
- Minimum from which to start frequency count.max
- Maximum with which to end frequency count.width
- Bin width of frequency distribution.
public int[] getFrequencyDist(float min, float max, float width, boolean ignore, float ignoreVal)
min
- Minimum from which to start frequency count.max
- Maximum with which to end frequency count.width
- Bin width of frequency distribution.ignore
- Ignores given value if true.ignoreVal
- value to ignore.
public int[] getHammockDist(int m)
m
- Modulus value.
public int[] getHammockDist(int m, float ignoreVal)
m
- Modulus value.ignoreVal
- Value to ignore in calculating hammock plot.
public boolean writeFile(String fileName, int fileType, GISFrame gisFrame)
fileName
- Name to save file under.fileType
- Type of file format to save.gisFrame
- GUI in which to report results.
FileHandler
public boolean writeFile(String fileName, int fileType, GISFrame gisFrame, LSThread lsThread)
fileName
- Name to save file under.fileType
- Type of file format to save.gisFrame
- GUI in which to report results.lsThread
- Thread that called this method (allowing it to be interrupted).
Can be null, in which case, method cannot be interrupted.
FileHandler
public boolean readFile(String fileName)
fileName
- Name to file to read.
public String toString()
toString
in class SpatialObject
public int getType()
getType
in interface SpatialModel
getType
in class SpatialObject
public int calcBorder()
public int getNumRows()
public int getNumCols()
public float getXRes()
public float getYRes()
public float getMaxAttribute()
getMaxAttribute
in class SpatialObject
public float getMinAttribute()
getMinAttribute
in class SpatialObject
public void updateBounds()
updateBounds
in class SpatialObject
public float getAttribute(Footprint fp)
getAttribute
in interface SpatialModel
getAttribute
in class SpatialObject
fp
- Location to query.
public float getAttribute(float easting, float northing)
easting
- Easting of location to query.northing
- Northing of location to query.
public float getAttribute(int row, int col)
row
- Array row coordinate of cell to query.col
- Array column coordinate of cell to query.
public float interpolateAttribute(Footprint fp)
fp
- Footprint of location to query.
public float interpolateAttribute(float easting, float northing)
easting
- Easting of location to query.northing
- Northing of location to query.
public float[][] getRasterArray()
public float[][] getWindow(int row, int col, int wSize)
row
- Row coordinate of the window centre.col
- Column coordinate of the window centre.wSize
- Window size.
public int getRow(float y)
y
- Northing to convert into row value.
getCol(float)
,
getFootprint(float, float)
public int getRow(float y, boolean ignoreBounds)
y
- Northing to convert into row value.ignoreBounds
- If true, row value will not be constrained.
getCol(float)
,
getFootprint(float, float)
public int getCol(float x)
x
- Easting to convert into column value.
getRow(float)
,
getFootprint(float, float)
public int getCol(float x, boolean ignoreBounds)
x
- Easting to convert into column value.ignoreBounds
- If true, column value will not be constrained.
getRow(float)
,
getFootprint(float, float)
public Footprint getFootprint(float row, float col)
row
- Array row coordinate of cell to query. Can be non-integer to calculate sub-pixel location.col
- Array column coordinate of cell to query. Can be non-integer to calculate sub-pixel location.
getRow(float)
,
getCol(float)
public int getRasterType()
public float getElevAngle()
public float getAzimAngle()
public float getpShade()
public float getpBlend()
public float getAspectWeight()
public float getShadeExaggeration()
public int getWSize()
public float getDecayExp()
public float getShine()
public float getDiffuse()
public float getSpecular()
public float getSlopeTol()
SurfParam.RIDGE
,
SurfParam.CHANNEL
,
SurfParam.PLANAR
public float getCurveTol()
public boolean setXRes(float xRes)
xRes
- Resolution in the x direction.
public boolean setYRes(float yRes)
yRes
- Resolution in the y direction.
public void setAttribute(int row, int col, float attribute)
row
- Array row coordinate of cell to set.col
- Array column coordinate of cell to set.
public void setAttribute(Footprint fp, float attribute)
fp
- Location of attribute to set.attribute
- New attribute of the raster cell.public void setAttributes(float[][] rastArray)
rastArray
- 2D array of raster values.public void setRasterType(int rasterType)
rasterType
- Type of raster stored.public void setElevAngle(float elev)
elev
- Sun elevation angle (in radians).public void setAzimAngle(float azim)
azim
- Sun azimuthal angle (in radians).public void setpShade(float pShade)
pShade
- Shaded relief proportion (0 - 1)public void setShadeExaggeration(float zScale)
zScale
- Vertcial exaggeration used for shaded relief.public void setAspectWeight(float aspectWeight)
aspectWeight
- Determines how much importance to give aspect in shading calculation.public void setWSize(int ws)
ws
- New local window size.public void setShine(float shine)
shine
- Shininess value (typically 0 - 50).public void setDiffuse(float diffuse)
diffuse
- Diffuse constant(0 - 1).public void setSpecular(float specular)
specular
- Specular constant(0 - 1).public void setDecayExp(float de)
de
- New local window distance decay exponent.public void setSlopeTol(float st)
st
- New slope tolerance in radians for feature extraction.SurfParam
public void setCurveTol(float ct)
ct
- New curvature tolerance for feature extraction.SurfParam
public void setpBlend(float p)
p
- Weighting (0-1) used for image blending.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |