Package hec.map.aidem
Class AiDemBaseMap
java.lang.Object
hec.map.MapObject
hec.map.aidem.AiDemBaseMap
- All Implemented Interfaces:
ElevationMap
,GridMap
,MapObjectInterface
,Serializable
- Direct Known Subclasses:
AiDemFltMap
,AiDemMap
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
protected float[]
protected WorldPt
protected float
protected float
protected float
protected int
protected int
Fields inherited from class hec.map.MapObject
_debug, _extent, _fileOpener, _loaded, _mapId, mCoordinateReferencySystem
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncellToWorldPt
(int cellIndex) Takes as input the array index from 0 to data.length-1 and computes the World Location for that data cell.cellToWorldPt
(int row, int col) Returns the World Location for a cell at a particular row/column in the grid.abstract boolean
fillArray
(float[] dest, long destPosition, long srcPosition, int length) int
int
float[]
getData()
float[]
getElevation
(double[] northing, double[] easting) Retruns an array of elevations for an array of northin/easting points.float
getElevation
(WorldPt pt) Returns an elevation value for a given point on the map.Returns a Rectangle that contains the world location for each corner of the grid.double
Returns the maximum value in the grid.double
Returns the minimum value found in the gridgetName()
Gets the Name attribute of the MapObjectInterface objectdouble
Returns the value that represents an UNDEFINED elevation in the map.double
Returns the width of each cell in the grid.double
Returns the height of each cell in the grid.protected void
init()
Initializes the variables for the class to a base state.void
load()
Method to tell the Map Object to load its data into memoryabstract void
void
setNoDataValue
(double noDataValue) boolean
void
unload()
Method to tell the Map Object to unload, because the map is doneint
worldPtToCell
(double pte, double ptn) int
worldPtToCell
(WorldPt pt) Converts a point in world coordinates to a an index into the data array.Methods inherited from class hec.map.MapObject
equals, getCoordinateInfo, getCoordinateReferenceSystem, getExtent, getFilenames, getFileOpener, getMapIdentifier, mapIdentifierEquals, newFile, newThenOpenFile, openFile, readProjection, setExtent, setFileOpener, setMapIdentifier, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface hec.map.MapObjectInterface
getCoordinateReferenceSystem, getExtent, getMapIdentifier, setExtent, setMapIdentifier
-
Field Details
-
_cellsize
protected double _cellsize -
_data
protected float[] _data -
_lowerLeftCorner
-
_maxElev
protected float _maxElev -
_minElev
protected float _minElev -
_nodata
protected float _nodata -
_numcol
protected int _numcol -
_numrow
protected int _numrow
-
-
Constructor Details
-
AiDemBaseMap
-
AiDemBaseMap
-
AiDemBaseMap
public AiDemBaseMap()
-
-
Method Details
-
load
Description copied from interface:MapObjectInterface
Method to tell the Map Object to load its data into memory- Specified by:
load
in interfaceMapObjectInterface
- Specified by:
load
in classMapObject
- Throws:
IOException
- Description of Exception
-
unload
public void unload()Description copied from interface:MapObjectInterface
Method to tell the Map Object to unload, because the map is done- Specified by:
unload
in interfaceMapObjectInterface
- Specified by:
unload
in classMapObject
-
getAreaHeight
public int getAreaHeight() -
getAreaWidth
public int getAreaWidth() -
getResolutionX
public double getResolutionX()Returns the width of each cell in the grid.- Returns:
-
getResolutionY
public double getResolutionY()Returns the height of each cell in the grid.- Returns:
-
supportsNoDataValue
public boolean supportsNoDataValue()- Specified by:
supportsNoDataValue
in interfaceGridMap
-
getData
public float[] getData() -
getLowerLeftCorner
-
getName
Description copied from interface:MapObjectInterface
Gets the Name attribute of the MapObjectInterface object- Specified by:
getName
in interfaceElevationMap
- Specified by:
getName
in interfaceMapObjectInterface
- Overrides:
getName
in classMapObject
- Returns:
- The Name value
-
getGridCellSize
Returns a Rectangle that contains the world location for each corner of the grid.- Specified by:
getGridCellSize
in interfaceGridMap
- Returns:
-
init
protected void init()Initializes the variables for the class to a base state. Sets the number of rows/columns to 0, the data array to null. -
getMinimumElevation
public double getMinimumElevation()Returns the minimum value found in the grid- Specified by:
getMinimumElevation
in interfaceElevationMap
- Returns:
-
getMaximumElevation
public double getMaximumElevation()Returns the maximum value in the grid.- Specified by:
getMaximumElevation
in interfaceElevationMap
- Returns:
-
getNoDataValue
public double getNoDataValue()Description copied from interface:ElevationMap
Returns the value that represents an UNDEFINED elevation in the map.- Specified by:
getNoDataValue
in interfaceElevationMap
- Specified by:
getNoDataValue
in interfaceGridMap
-
setNoDataValue
public void setNoDataValue(double noDataValue) - Parameters:
noDataValue
-
-
cellToWorldPt
Returns the World Location for a cell at a particular row/column in the grid. The WorldPt references the upper left point of the cell from which the row,col point references. Grid Point (0,0) is the upper left corner of the grid.- Parameters:
row
- the row index in Grid Coordinates (0 - getAreaHeight()), row 0 is the top of the grid.col
- the col index in Grid Coordinates (0 - getAreaWidth()), col 0 is the left side of the grid.- Returns:
-
cellToWorldPt
Takes as input the array index from 0 to data.length-1 and computes the World Location for that data cell. The WorldPt references the upper left point of the cell from which the index references- Parameters:
cellIndex
- index 0 is the upper left corner of the grid, index (data.length-1) is the lower right corner.- Returns:
- WorldPt that contains the location of the cell at that index.
-
getElevation
public float[] getElevation(double[] northing, double[] easting) Description copied from interface:ElevationMap
Retruns an array of elevations for an array of northin/easting points. Northing/Easting array values are paired northing[0],easting[0], etc to make one point. Throws an invalid value exception if the northing/easting arrays are not the same size.- Specified by:
getElevation
in interfaceElevationMap
- Returns:
- array of elevation points. The elevation value elevation[n] was derived using the point (easting[n],northing[n]).
-
getElevation
Returns an elevation value for a given point on the map. If that point is outside the bounds of the map, returns RMAConst.UNDEF_FLOAT. If that point is within the bounds of the map, but yet at a point where there is no data, the NO_DATA_VALUE is returned. The exact value of this can be fetched with the methodgetNoDataValue()
- Specified by:
getElevation
in interfaceElevationMap
- Parameters:
pt
- WorldPt- Returns:
- float
-
worldPtToCell
Converts a point in world coordinates to a an index into the data array. The value will range from 0 to data.length-1. An index value of 0 is the upper left corner of the grid, and data.length-1 is the lower right.- Parameters:
pt
-- Returns:
- the index into the float array.
-
worldPtToCell
public int worldPtToCell(double pte, double ptn) -
loadHeader
- Throws:
IOException
-
fillArray
public abstract boolean fillArray(float[] dest, long destPosition, long srcPosition, int length) throws IOException - Throws:
IOException
-