gistoolkit.datasources.shapefile
Class ShapeFile

java.lang.Object
  extended bygistoolkit.datasources.shapefile.ShapeFile

public class ShapeFile
extends java.lang.Object

Represents a shape file on the disk.


Field Summary
static int SHAPE_MULTIPATCH
           
static int SHAPE_MULTIPOINT
           
static int SHAPE_MULTIPOINTM
           
static int SHAPE_MULTIPOINTZ
           
static int SHAPE_NULL
          Constants for accessing the various shape types.
static int SHAPE_POINT
           
static int SHAPE_POINTM
           
static int SHAPE_POINTZ
           
static int SHAPE_POLYGON
           
static int SHAPE_POLYGONM
           
static int SHAPE_POLYGONZ
           
static int SHAPE_POLYLINE
           
static int SHAPE_POLYLINEM
           
static int SHAPE_POLYLINEZ
           
 
Constructor Summary
ShapeFile()
          Create a new blank shape file, not too usefull
ShapeFile(java.lang.String inFileName)
          Constructor to create a new Shape File with the given file name.
 
Method Summary
 void addColumn(java.lang.String inName, char inType, int inLength, int inDecimalPosition)
          Adds a column to the shape file.
static char getFieldType(AttributeType inAttributeType)
          returns the dbf file type for the attribute sent in.
 ShapeFileRecord[] getRecords()
          Retrieves the records from the shape file.
static java.lang.String getShapeName(int inShapeType)
          Returns a string representing the given shape type.
static int getShapeType(Shape inShape)
          Returns the numerical type for the given shape.
 void readRecords()
          Read the records from a shape file.
 void readRecords(LEDataInputStream in)
          Read the records from a shape file.
 void removeColumn(java.lang.String inName)
          Removes a named column from the shape file
 void setFile(java.lang.String inFileName)
          Set the file name for this shape file.
 void setRecords(ShapeFileRecord[] inRecords)
          Sets the records for the shape file.
 void writeRecords()
          Writes the records to a shape file.
 void writeRecords(LEDataOutputStream out, LEDataOutputStream idxout)
          Read the records from a shape file.
 
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
Constants for accessing the various shape types.

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_POINTZ

public static final int SHAPE_POINTZ
See Also:
Constant Field Values

SHAPE_POLYLINEZ

public static final int SHAPE_POLYLINEZ
See Also:
Constant Field Values

SHAPE_POLYGONZ

public static final int SHAPE_POLYGONZ
See Also:
Constant Field Values

SHAPE_MULTIPOINTZ

public static final int SHAPE_MULTIPOINTZ
See Also:
Constant Field Values

SHAPE_POINTM

public static final int SHAPE_POINTM
See Also:
Constant Field Values

SHAPE_POLYLINEM

public static final int SHAPE_POLYLINEM
See Also:
Constant Field Values

SHAPE_POLYGONM

public static final int SHAPE_POLYGONM
See Also:
Constant Field Values

SHAPE_MULTIPOINTM

public static final int SHAPE_MULTIPOINTM
See Also:
Constant Field Values

SHAPE_MULTIPATCH

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

ShapeFile

public ShapeFile()
Create a new blank shape file, not too usefull


ShapeFile

public ShapeFile(java.lang.String inFileName)
Constructor to create a new Shape File with the given file name.

Method Detail

setFile

public void setFile(java.lang.String inFileName)
Set the file name for this shape file. The case-sensitive logic is needed for filesystems where case is relevant.


addColumn

public void addColumn(java.lang.String inName,
                      char inType,
                      int inLength,
                      int inDecimalPosition)
               throws java.lang.Exception
Adds a column to the shape file.

Throws:
java.lang.Exception

removeColumn

public void removeColumn(java.lang.String inName)
Removes a named column from the shape file


getRecords

public ShapeFileRecord[] getRecords()
Retrieves the records from the shape file.


readRecords

public void readRecords()
                 throws java.lang.Exception
Read the records from a shape file.

Throws:
java.lang.Exception

readRecords

public void readRecords(LEDataInputStream in)
                 throws java.lang.Exception
Read the records from a shape file.

Throws:
java.lang.Exception

setRecords

public void setRecords(ShapeFileRecord[] inRecords)
                throws java.lang.Exception
Sets the records for the shape file.

Throws:
java.lang.Exception

writeRecords

public void writeRecords()
                  throws java.lang.Exception
Writes the records to a shape file.

Throws:
java.lang.Exception

writeRecords

public void writeRecords(LEDataOutputStream out,
                         LEDataOutputStream idxout)
                  throws java.lang.Exception
Read the records from a shape file.

Throws:
java.lang.Exception

getShapeType

public static int getShapeType(Shape inShape)
                        throws java.lang.Exception
Returns the numerical type for the given shape.

Throws:
java.lang.Exception

getShapeName

public static java.lang.String getShapeName(int inShapeType)
Returns a string representing the given shape type.


getFieldType

public static char getFieldType(AttributeType inAttributeType)
returns the dbf file type for the attribute sent in.