Package hec.map.aishape
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
September 1998
- See Also:
-
Field Summary
Fields inherited from class hec.map.MapObject
_debug, _extent, _fileOpener, _loaded, _mapId, mCoordinateReferencySystem
Fields inherited from interface hec.map.aishape.AiShapeConst
DEBUG, FILE_CODE, HIGHLIGHT_MODIFIER, QUERY_FLASH_LENGTH, SHAPE_TYPE_ARC, SHAPE_TYPE_MULTI_POINT, SHAPE_TYPE_NULL, SHAPE_TYPE_POINT, SHAPE_TYPE_POINT_M, SHAPE_TYPE_POINT_Z, SHAPE_TYPE_POLYGON, SHAPE_TYPE_POLYGON_M, SHAPE_TYPE_POLYGON_Z, SHAPE_TYPE_POLYLINE_M, SHAPE_TYPE_POLYLINE_Z, VERSION, XY_QUERY_TOLERANCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Calculate and return the shp file length in bytes.int
Calculate and return the shx file length in bytes.void
Deprecated.Returns the coordinate reference system that describes the location of this map.return the list of File names that the MapObject has.getShapeObjects
(double containmentBuffer, WorldPt pt) Returns a list of "Import" Shape Objects from this source.int
getType()
void
highlightRecords
(List shapes, int centerPointGraphic) void
init()
void
load()
Read shape file for shape type.boolean
readFile
(MapIdentifier shpId) Read the three associated shape files.boolean
readProjection
(Identifier prjId) Reads the project for the shapefile.void
void
unload()
Decrement the refernce counter.void
Set this map's data to the arg data and write it to file.boolean
writeFile
(Identifier shpId) Methods inherited from class hec.map.MapObject
equals, getExtent, getFileOpener, getMapIdentifier, getName, mapIdentifierEquals, newFile, newThenOpenFile, openFile, 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
getExtent, getMapIdentifier, getName, setExtent, setMapIdentifier
Methods inherited from interface hec.map.importer.ShapeSource
getName
-
Constructor Details
-
AiShapeMap
-
AiShapeMap
-
AiShapeMap
public AiShapeMap()
-
-
Method Details
-
getType
public int getType() -
init
public void init() -
getShapes
Description copied from interface:ShapeSource
Returns a list of "Import" Shape Objects from this source.- Specified by:
getShapes
in interfaceShapeSource
- Returns:
-
getAttributes
-
getFieldDescriptors
- Specified by:
getFieldDescriptors
in interfaceShapeSource
- Returns:
-
getShapeObjects
-
writeData
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
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 interfaceMapObjectInterface
- Specified by:
load
in classMapObject
- 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 interfaceMapObjectInterface
- Specified by:
unload
in classMapObject
-
writeFile
-
readProjection
Reads the project for the shapefile. We have kept the "coordianteInfo" routines for backwards compatibility. New users should use getCoordinateReferenceSystem();- Overrides:
readProjection
in classMapObject
- Parameters:
prjId
-- Returns:
-
readFile
Read the three associated shape files. -
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
-
highlightRecords
- Specified by:
highlightRecords
in interfaceShapeSource
-
clearHighlights
public void clearHighlights()- Specified by:
clearHighlights
in interfaceShapeSource
-
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 interfaceMapObjectInterface
- Specified by:
getCoordinateReferenceSystem
in interfaceShapeSource
- Overrides:
getCoordinateReferenceSystem
in classMapObject
- Returns:
- the WKT or NULL if there is no projection.
-
getCoordinateInfo
Deprecated.- Overrides:
getCoordinateInfo
in classMapObject
-
setCoordinateReferenceSystem
- Parameters:
crs
-
-