org.progeeks.geo
Class EsriShapeReader

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

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

Reads Geo shapes from an ESRI SHP file. This really belongs in a sub-package but I'm simplifying in the interest of time.

Version:
$Revision: 1.2 $
Author:
Paul Speed

Field Summary
static int SHAPE_MULTIPATCH
           
static int SHAPE_MULTIPOINT
           
static int SHAPE_MULTIPOINT_M
           
static int SHAPE_MULTIPOINT_Z
           
static int SHAPE_NULL
           
static int SHAPE_POINT
           
static int SHAPE_POINT_M
           
static int SHAPE_POINT_Z
           
static int SHAPE_POLYGON
           
static int SHAPE_POLYGON_M
           
static int SHAPE_POLYGON_Z
           
static int SHAPE_POLYLINE
           
static int SHAPE_POLYLINE_M
           
static int SHAPE_POLYLINE_Z
           
 
Constructor Summary
EsriShapeReader(java.io.InputStream in)
           
 
Method Summary
static java.lang.String getShapeTypeString(int type)
           
 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
 

Field Detail

SHAPE_NULL

public static final int SHAPE_NULL
See Also:
Constant Field Values

SHAPE_POINT

public static final int SHAPE_POINT
See Also:
Constant Field Values

SHAPE_POLYLINE

public static final int SHAPE_POLYLINE
See Also:
Constant Field Values

SHAPE_POLYGON

public static final int SHAPE_POLYGON
See Also:
Constant Field Values

SHAPE_MULTIPOINT

public static final int SHAPE_MULTIPOINT
See Also:
Constant Field Values

SHAPE_POINT_Z

public static final int SHAPE_POINT_Z
See Also:
Constant Field Values

SHAPE_POLYLINE_Z

public static final int SHAPE_POLYLINE_Z
See Also:
Constant Field Values

SHAPE_POLYGON_Z

public static final int SHAPE_POLYGON_Z
See Also:
Constant Field Values

SHAPE_MULTIPOINT_Z

public static final int SHAPE_MULTIPOINT_Z
See Also:
Constant Field Values

SHAPE_POINT_M

public static final int SHAPE_POINT_M
See Also:
Constant Field Values

SHAPE_POLYLINE_M

public static final int SHAPE_POLYLINE_M
See Also:
Constant Field Values

SHAPE_POLYGON_M

public static final int SHAPE_POLYGON_M
See Also:
Constant Field Values

SHAPE_MULTIPOINT_M

public static final int SHAPE_MULTIPOINT_M
See Also:
Constant Field Values

SHAPE_MULTIPATCH

public static final int SHAPE_MULTIPATCH
See Also:
Constant Field Values
Constructor Detail

EsriShapeReader

public EsriShapeReader(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)


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