com.bbn.openmap.dataAccess.shape.input
Class ShpInputStream

java.lang.Object
  |
  +--com.bbn.openmap.dataAccess.shape.input.ShpInputStream
All Implemented Interfaces:
ShapeConstants

public class ShpInputStream
extends java.lang.Object
implements ShapeConstants

Reads geometry data from a .shp file.

Author:
Doug Van Auken

Field Summary
protected  DrawingAttributes drawingAttributes
           
 
Fields inherited from interface com.bbn.openmap.dataAccess.shape.ShapeConstants
DBF_CHARACTER, DBF_DATE, DBF_LOGICAL, DBF_MEMO, DBF_NUMERIC, DBF_TYPE_CHARACTER, DBF_TYPE_DATE, DBF_TYPE_LOGICAL, DBF_TYPE_MEMO, DBF_TYPE_NUMERIC, PARAM_DBF, PARAM_SHP, PARAM_SHX, SHAPE_DBF_DASHPATTERN, SHAPE_DBF_DASHPHASE, SHAPE_DBF_DESCRIPTION, SHAPE_DBF_FILLCOLOR, SHAPE_DBF_LINECOLOR, SHAPE_DBF_LINEWIDTH, SHAPE_DBF_SELECTCOLOR, SHAPE_FILE_HEADER_LENGTH, SHAPE_FILE_RECORD_HEADER_LENGTH, SHAPE_TYPE_ARC, SHAPE_TYPE_MULTIPOINT, SHAPE_TYPE_NULL, SHAPE_TYPE_POINT, SHAPE_TYPE_POLYGON, SHAPE_TYPE_POLYLINE
 
Constructor Summary
ShpInputStream(java.io.InputStream is)
          Constructor
 
Method Summary
 DrawingAttributes getDrawingAttributes()
          Get the DrawingAttributes used for drawing the graphics.
 EsriGraphicList getGeometry(int[][] indexData)
          Reads geometry from a .shp file
 EsriGraphicList getPointGeometry(int[][] indexData)
          Iterates through the given input stream to contruct geometry objects
 EsriGraphicList getPolyGeometry(int[][] indexData, int shapeType)
          Iterates through the given input stream to contruct geometry objects
 int readHeader()
          Reads the header section of a .shp file
 void setDrawingAttributes(DrawingAttributes da)
          Set the DrawingAttributes to use for drawing the graphics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

drawingAttributes

protected DrawingAttributes drawingAttributes
Constructor Detail

ShpInputStream

public ShpInputStream(java.io.InputStream is)
Constructor

Parameters:
is - An inputstream to chain with LittleEndianInputStream
Method Detail

setDrawingAttributes

public void setDrawingAttributes(DrawingAttributes da)
Set the DrawingAttributes to use for drawing the graphics.


getDrawingAttributes

public DrawingAttributes getDrawingAttributes()
Get the DrawingAttributes used for drawing the graphics.


getGeometry

public EsriGraphicList getGeometry(int[][] indexData)
                            throws java.lang.Exception
Reads geometry from a .shp file

Parameters:
indexData - The index data retreived from the .shx file
Returns:
EsriGraphicList A list of geometry
java.lang.Exception

getPointGeometry

public EsriGraphicList getPointGeometry(int[][] indexData)
                                 throws java.lang.Exception
Iterates through the given input stream to contruct geometry objects

Parameters:
indexData - A list of offsets obtained by iterating through the associated SHX file
Returns:
list An OMGraphicList that contains the collection of objects created by iterating through this input stream
java.lang.Exception

getPolyGeometry

public EsriGraphicList getPolyGeometry(int[][] indexData,
                                       int shapeType)
                                throws java.lang.Exception
Iterates through the given input stream to contruct geometry objects

Parameters:
shapeType - the type of shape to read
indexData - A list of offsets obtained by iterating through the associated SHX file
Returns:
list An OMGraphicList that contains the collection of objects created by iterating through this input stream
java.lang.Exception

readHeader

public int readHeader()
               throws java.io.IOException
Reads the header section of a .shp file

Returns:
the shape type
java.io.IOException


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details