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 doubleprotected float[]protected WorldPtprotected floatprotected floatprotected floatprotected intprotected intFields 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 booleanfillArray(float[] dest, long destPosition, long srcPosition, int length) intintfloat[]getData()float[]getElevation(double[] northing, double[] easting) Retruns an array of elevations for an array of northin/easting points.floatgetElevation(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.doubleReturns the maximum value in the grid.doubleReturns the minimum value found in the gridgetName()Gets the Name attribute of the MapObjectInterface objectdoubleReturns the value that represents an UNDEFINED elevation in the map.doubleReturns the width of each cell in the grid.doubleReturns the height of each cell in the grid.protected voidinit()Initializes the variables for the class to a base state.voidload()Method to tell the Map Object to load its data into memoryabstract voidvoidsetNoDataValue(double noDataValue) booleanvoidunload()Method to tell the Map Object to unload, because the map is doneintworldPtToCell(double pte, double ptn) intworldPtToCell(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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:MapObjectInterfaceMethod to tell the Map Object to load its data into memory- Specified by:
loadin interfaceMapObjectInterface- Specified by:
loadin classMapObject- Throws:
IOException- Description of Exception
-
unload
public void unload()Description copied from interface:MapObjectInterfaceMethod to tell the Map Object to unload, because the map is done- Specified by:
unloadin interfaceMapObjectInterface- Specified by:
unloadin 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:
supportsNoDataValuein interfaceGridMap
-
getData
public float[] getData() -
getLowerLeftCorner
-
getName
Description copied from interface:MapObjectInterfaceGets the Name attribute of the MapObjectInterface object- Specified by:
getNamein interfaceElevationMap- Specified by:
getNamein interfaceMapObjectInterface- Overrides:
getNamein classMapObject- Returns:
- The Name value
-
getGridCellSize
Returns a Rectangle that contains the world location for each corner of the grid.- Specified by:
getGridCellSizein 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:
getMinimumElevationin interfaceElevationMap- Returns:
-
getMaximumElevation
public double getMaximumElevation()Returns the maximum value in the grid.- Specified by:
getMaximumElevationin interfaceElevationMap- Returns:
-
getNoDataValue
public double getNoDataValue()Description copied from interface:ElevationMapReturns the value that represents an UNDEFINED elevation in the map.- Specified by:
getNoDataValuein interfaceElevationMap- Specified by:
getNoDataValuein 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:ElevationMapRetruns 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:
getElevationin 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:
getElevationin 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
-