Class AiShapeMap

java.lang.Object
hec.map.MapObject
hec.map.aishape.AiShapeMap
All Implemented Interfaces:
AiShapeConst, ShapeSource, MapObjectInterface, Serializable

public class AiShapeMap extends MapObject implements Serializable, MapObjectInterface, AiShapeConst, ShapeSource
AiShape class manages map layers that conform to the Arc Info shapefile standard
September 1998
See Also:
  • Constructor Details

    • AiShapeMap

      public AiShapeMap(String path)
    • AiShapeMap

      public AiShapeMap(MapIdentifier id)
    • AiShapeMap

      public AiShapeMap()
  • Method Details

    • getType

      public int getType()
    • init

      public void init()
    • getShapes

      public List<AiShapeObject> getShapes()
      Description copied from interface: ShapeSource
      Returns a list of "Import" Shape Objects from this source.
      Specified by:
      getShapes in interface ShapeSource
      Returns:
    • getAttributes

      public Vector<Attribute> getAttributes()
    • getFieldDescriptors

      public Vector<AiShapeFieldDescriptor> getFieldDescriptors()
      Specified by:
      getFieldDescriptors in interface ShapeSource
      Returns:
    • getShapeObjects

      public List getShapeObjects(double containmentBuffer, WorldPt pt)
    • writeData

      public void writeData(int type, List fieldDescriptors, List shapes, List attributes)
      Set this map's data to the arg data and write it to file.
    • calculateShpFileLength

      public int calculateShpFileLength()
      Calculate and return the shp file length in bytes.
    • calculateShxFileLength

      public int calculateShxFileLength()
      Calculate and return the shx file length in bytes.
    • load

      public void load() throws IOException
      Read shape file for shape type. Read consists of reading three separate files:
      *.shp - main shape file data
      *.shx - an index file containg offset and content length for shape objects in *.shp file
      *.dbf - dbase format file containing attributes
      Specified by:
      load in interface MapObjectInterface
      Specified by:
      load in class MapObject
      Throws:
      IOException - Description of Exception
    • unload

      public void unload()
      Decrement the refernce counter. If the number of references goes below 1, unload the data for the Image.
      Specified by:
      unload in interface MapObjectInterface
      Specified by:
      unload in class MapObject
    • writeFile

      public boolean writeFile(Identifier shpId)
    • readProjection

      public boolean readProjection(Identifier prjId)
      Reads the project for the shapefile. We have kept the "coordianteInfo" routines for backwards compatibility. New users should use getCoordinateReferenceSystem();

      Overrides:
      readProjection in class MapObject
      Parameters:
      prjId -

      Returns:
    • readFile

      public boolean readFile(MapIdentifier shpId)
      Read the three associated shape files.
    • 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
    • highlightRecords

      public void highlightRecords(List shapes, int centerPointGraphic)
      Specified by:
      highlightRecords in interface ShapeSource
    • clearHighlights

      public void clearHighlights()
      Specified by:
      clearHighlights in interface ShapeSource
    • getCoordinateReferenceSystem

      public CoordinateReferenceSystem getCoordinateReferenceSystem()
      Description copied from class: MapObject
      Returns the coordinate reference system that describes the location of this map. Users can return NULL if they don't have CoordinateReferenceSystem.

      Specified by:
      getCoordinateReferenceSystem in interface MapObjectInterface
      Specified by:
      getCoordinateReferenceSystem in interface ShapeSource
      Overrides:
      getCoordinateReferenceSystem in class MapObject
      Returns:
      the WKT or NULL if there is no projection.
    • getCoordinateInfo

      @Deprecated public CoordinateInfo getCoordinateInfo()
      Deprecated.
      Overrides:
      getCoordinateInfo in class MapObject
    • setCoordinateReferenceSystem

      public void setCoordinateReferenceSystem(CoordinateReferenceSystem crs)
      Parameters:
      crs -