Package hec.map.aidem

Class 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 Details

  • Constructor Details

    • AiDemFltMap

      public AiDemFltMap(String fileName)
    • AiDemFltMap

      public AiDemFltMap(MapIdentifier id)
    • AiDemFltMap

      public AiDemFltMap()
  • Method Details

    • getFilenames

      public List 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 class MapObject
      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 interface MapObjectInterface
      Overrides:
      unload in class AiDemBaseMap
    • load

      public void load() throws IOException
      Loads the binary
      Specified by:
      load in interface MapObjectInterface
      Overrides:
      load in class AiDemBaseMap
      Throws:
      IOException - Description of Exception
    • loadHeader

      public void loadHeader() throws IOException
      Specified by:
      loadHeader in class AiDemBaseMap
      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 class AiDemBaseMap
      Throws:
      IOException
    • loadBin

      public void loadBin(HecFile file) throws IOException
      Throws:
      IOException
    • writeFile

      public boolean writeFile(Identifier fltId)
    • writeHeader

      protected boolean writeHeader(Identifier hdrId)
      Parameters:
      hdrId -
      Returns:
    • setElevation

      public boolean setElevation(WorldPt pt, float val)
      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 method getNoDataValue()
      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

      public void setLowerLeftCorner(WorldPt wpt)
    • setCellSize

      public void setCellSize(double cellSize)
      sets the width/height of each cell in the grid.
    • mapIdentifierEquals

      public boolean mapIdentifierEquals(MapIdentifier mapid)
      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 class MapObject
      Parameters:
      mapid -
      Returns:
      true if the mapid references the same map file as this map.