Package hec.map.aidem
Class AiDemFltMap
java.lang.Object
hec.map.MapObject
hec.map.aidem.AiDemBaseMap
hec.map.aidem.AiDemFltMap
- All Implemented Interfaces:
ElevationMap
,GridMap
,MapObjectInterface
,Serializable
public class AiDemFltMap
extends AiDemBaseMap
implements Serializable, MapObjectInterface, ElevationMap, GridMap
Map Object class for reading ESRI Binary Grid files. The Binary Grid file data are stored in two
files, a .flt and a .hdr. The FLT file contains all of the binary grid data, and the HDR file contains
the header information such as grid location and cell size.
- See Also:
-
Field Summary
FieldsFields inherited from class hec.map.aidem.AiDemBaseMap
_cellsize, _data, _lowerLeftCorner, _maxElev, _minElev, _nodata, _numcol, _numrow
Fields inherited from class hec.map.MapObject
_debug, _extent, _fileOpener, _loaded, _mapId, mCoordinateReferencySystem
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
fillArray
(float[] dest, long destPosition, long srcPosition, int length) Fills the destination array with data from this map starting at destPosition reading from srcPosition for length # of values.return the list of File names that the MapObject has.void
load()
Loads the binaryvoid
void
boolean
mapIdentifierEquals
(MapIdentifier mapid) check to see if the Map specified by the MapIdentifier mapid is the same map as this one.void
setAreaHeight
(int numRow) set the number of rows in the map and redimensions the map.void
setAreaSize
(int rows, int cols) void
setAreaWidth
(int numCol) set the number of columns in the map and redimensions the map.void
setCellSize
(double cellSize) sets the width/height of each cell in the grid.boolean
setElevation
(double e, double n, float val) boolean
setElevation
(WorldPt pt, float val) set an elevation value for a given point on the map.void
void
unload()
Method to tell the Map Object to unload, because the map is doneboolean
writeFile
(Identifier fltId) protected boolean
writeHeader
(Identifier hdrId) Methods inherited from class hec.map.aidem.AiDemBaseMap
cellToWorldPt, cellToWorldPt, getAreaHeight, getAreaWidth, getData, getElevation, getElevation, getGridCellSize, getLowerLeftCorner, getMaximumElevation, getMinimumElevation, getName, getNoDataValue, getResolutionX, getResolutionY, init, setNoDataValue, supportsNoDataValue, worldPtToCell, worldPtToCell
Methods inherited from class hec.map.MapObject
equals, getCoordinateInfo, getCoordinateReferenceSystem, getExtent, getFileOpener, getMapIdentifier, 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.ElevationMap
getElevation, getElevation, getMaximumElevation, getMinimumElevation, getName
Methods inherited from interface hec.map.GridMap
getGridCellSize, getNoDataValue, supportsNoDataValue
Methods inherited from interface hec.map.MapObjectInterface
getCoordinateReferenceSystem, getExtent, getMapIdentifier, setExtent, setMapIdentifier
-
Field Details
-
EXTENSION
- See Also:
-
-
Constructor Details
-
AiDemFltMap
-
AiDemFltMap
-
AiDemFltMap
public AiDemFltMap()
-
-
Method Details
-
getFilenames
Description copied from class:MapObject
return the list of File names that the MapObject has. The first filename in the list must be the main file (ie for shape files it should be the .shp file, usually_mapId.getPath()
). Subclasses should override this method if they have more than 1 file.- Overrides:
getFilenames
in classMapObject
- Returns:
- the list of Map File names
-
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
- Overrides:
unload
in classAiDemBaseMap
-
load
Loads the binary- Specified by:
load
in interfaceMapObjectInterface
- Overrides:
load
in classAiDemBaseMap
- Throws:
IOException
- Description of Exception
-
loadHeader
- Specified by:
loadHeader
in classAiDemBaseMap
- Throws:
IOException
-
fillArray
public boolean fillArray(float[] dest, long destPosition, long srcPosition, int length) throws IOException Fills the destination array with data from this map starting at destPosition reading from srcPosition for length # of values.- Specified by:
fillArray
in classAiDemBaseMap
- Throws:
IOException
-
loadBin
- Throws:
IOException
-
writeFile
-
writeHeader
- Parameters:
hdrId
-- Returns:
-
setElevation
set an elevation value for a given point on the map. If that point is outside the bounds of the map, nothing is set with the methodgetNoDataValue()
- Parameters:
pt
- WorldPt- Returns:
- float
-
setElevation
public boolean setElevation(double e, double n, float val) -
setAreaHeight
public void setAreaHeight(int numRow) set the number of rows in the map and redimensions the map. existing data is lost- Parameters:
numRow
- new number of rows
-
setAreaWidth
public void setAreaWidth(int numCol) set the number of columns in the map and redimensions the map. existing data is lost- Parameters:
numCol
- new number of columns
-
setAreaSize
public void setAreaSize(int rows, int cols) -
setLowerLeftCorner
-
setCellSize
public void setCellSize(double cellSize) sets the width/height of each cell in the grid. -
mapIdentifierEquals
check to see if the Map specified by the MapIdentifier mapid is the same map as this one. AiDem files create a binary version of the ascii file so the test needs to check both the .asc and the .ascbin extensions.- Overrides:
mapIdentifierEquals
in classMapObject
- Parameters:
mapid
-- Returns:
- true if the mapid references the same map file as this map.
-