org.progeeks.geo.esri
Class ShapeReader

java.lang.Object
  extended by org.progeeks.geo.esri.ShapeReader
All Implemented Interfaces:
java.util.Iterator

public class ShapeReader
extends java.lang.Object
implements java.util.Iterator

Reads esri.shape meta objects from an ESRI SHP file.

Version:
$Revision: 1.4 $
Author:
Steve Ingram

Constructor Summary
ShapeReader(java.io.InputStream in)
           
 
Method Summary
 int getFileCode()
          Should be 9994
 int getFileLength()
          File length of the shape file in 16 bit words
 MetaObject getLayerExtent()
           
 int getShapeType()
           
static java.lang.String getShapeTypeString(int type)
           
 int getVersion()
          Should be 1000
 boolean hasNext()
          Returns true if there are still more shapes in the file.
 java.lang.Object next()
          Returns the next shape in the file.
 java.lang.Object readGeoShape()
          Reads the next shape from the file.
protected  void readHeader()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeReader

public ShapeReader(java.io.InputStream in)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

readHeader

protected void readHeader()
                   throws java.io.IOException
Throws:
java.io.IOException

hasNext

public boolean hasNext()
Returns true if there are still more shapes in the file.

Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Returns the next shape in the file.

Specified by:
next in interface java.util.Iterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

readGeoShape

public java.lang.Object readGeoShape()
                              throws java.io.IOException
Reads the next shape from the file.

Throws:
java.io.IOException

getShapeTypeString

public static java.lang.String getShapeTypeString(int type)

getFileCode

public int getFileCode()
Should be 9994

Returns:
Returns the fileCode.

getFileLength

public int getFileLength()
File length of the shape file in 16 bit words

Returns:
Returns the fileLength.

getLayerExtent

public MetaObject getLayerExtent()
Returns:
Returns the layerExtent.

getShapeType

public int getShapeType()
Returns:
Returns the shapeType.

getVersion

public int getVersion()
Should be 1000

Returns:
Returns the version.


Copyright © 2002-2003 Paul Speed. All Rights Reserved.