|
NVS Shapefile library Version 3.2 NVision Solutions, Inc. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.nvs.shapefile.Shapefile
The Shapefile class represents an ESRI shapefile
| Field Summary | |
static int |
FIELDTYPE_CHARACTER
Field type value of a string record field ('C') |
static int |
FIELDTYPE_DATE
Field type value of a string record field ('D') |
static int |
FIELDTYPE_FLOAT
Field type value of a string record field ('F') |
static int |
FIELDTYPE_LOGICAL
Field type value of a string record field ('L') |
static int |
FIELDTYPE_NUMBER
Field type value of a string record field ('N') |
static int |
SHAPETYPE_MULTIPOINT
Shape type value of a MultiPoint shapefile type descriptor (8) |
static int |
SHAPETYPE_POINT
Shape type value of a Point shapefile type descriptor (1) |
static int |
SHAPETYPE_POLYGON
Shape type value of a Polygon shapefile type descriptor (5) |
static int |
SHAPETYPE_POLYLINE
Shape type value of a PolyLine shapefile type descriptor (3) |
| Constructor Summary | |
Shapefile()
Creates a new Shapefile with no shapes, no type, and a BoundingBox with all values set to zero. |
|
Shapefile(java.io.InputStream mainInput,
java.io.InputStream indexInput,
java.io.InputStream recordsInput)
Constructs a new Shapefile object by reading the specified streams |
|
Shapefile(int type)
Creates a new Shapefile with the specified type, no shapes, and a BoundingBox with all values set to zero. |
|
Shapefile(java.lang.String fileName)
Constructs a new Shapefile object by reading the specified file If the index and/or records files cannot be found, no exception is thrown. |
|
| Method Summary | |
void |
addShapeObject(com.nvs.shapefile.ShapeObject obj)
Adds the specified ShapeObject to this Shapefile |
void |
computeExtents()
Computes the minimum extents for this Shapefile and sets its BoundingBox to them |
com.nvs.shapefile.BoundingBox |
getBoundingBox()
Returns the BoundingBox of this Shapefile |
com.nvs.shapefile.ShapeObject |
getShapeObject(int index)
Returns the ShapeObject at the specified index |
int |
getShapeObjectCount()
Returns the number of ShapeObjects in this Shapefile |
java.util.ArrayList |
getShapeObjects()
Returns all ShapeObjects in this Shapefile |
com.nvs.shapefile.TableDescription |
getTableDescription()
Returns this Shapefile's TableDescription |
int |
getType()
Returns the type of this Shapefile |
java.util.ArrayList |
getWarningMessages()
Returns an ArrayList of Strings representing warning messages that have occured in read/write operations |
void |
removeShapeObject(int index)
Removes the ShapeObject at the specified index |
void |
setBoundingBox(com.nvs.shapefile.BoundingBox box)
Sets the BoundingBox of this Shapefile |
void |
setShapeObjects(java.util.Collection collection)
Sets the ShapeObjects in this Shapefile to those in the specified collection |
void |
setTableDescription(com.nvs.shapefile.TableDescription tableDesc)
Sets the TableDescription for this Shapefile |
void |
setType(int type)
Sets the type of this Shapefile |
void |
write(java.io.OutputStream mainOutput,
java.io.OutputStream indexOutput,
java.io.OutputStream recordsOutput)
Writes this shapefile to the specified streams |
void |
write(java.lang.String fileName)
Writes this Shapefile |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SHAPETYPE_POINT
public static final int SHAPETYPE_MULTIPOINT
public static final int SHAPETYPE_POLYLINE
public static final int SHAPETYPE_POLYGON
public static final int FIELDTYPE_CHARACTER
public static final int FIELDTYPE_NUMBER
public static final int FIELDTYPE_FLOAT
public static final int FIELDTYPE_DATE
public static final int FIELDTYPE_LOGICAL
| Constructor Detail |
public Shapefile()
public Shapefile(int type)
public Shapefile(java.lang.String fileName)
throws InvalidFileException,
java.io.IOException
fileName - The first part of the file to be read java.io.FileNotFoundException - if the main file (.shp) cannot be found
InvalidFileException - when the specified shapefile is invalid
java.io.IOException
public Shapefile(java.io.InputStream mainInput,
java.io.InputStream indexInput,
java.io.InputStream recordsInput)
throws InvalidFileException,
java.io.IOException
mainInput - The InputStream associated with the ".shp" fileindexInput - The InputStream associated with the ".shx" file
recordsInput - The InputStream associated with the ".dbf" file
InvalidFileException - when the specified shapefile is invalid
java.io.IOException - when there's an IO problem with the streams| Method Detail |
public int getShapeObjectCount()
public void write(java.lang.String fileName)
throws java.io.IOException
fileName - The first part of the file to be written java.io.IOException - when there is a problem writing the file
public void write(java.io.OutputStream mainOutput,
java.io.OutputStream indexOutput,
java.io.OutputStream recordsOutput)
throws java.io.IOException
mainOutput - The InputStream associated with the ".shp" fileindexOutput - The InputStream associated with the ".shx" file
recordsOutput - The InputStream associated with the ".dbf" file
java.io.IOException - when there's an IO problem with the streamspublic int getType()
public void setType(int type)
type - the type of this shapefile as an int
public void addShapeObject(com.nvs.shapefile.ShapeObject obj)
throws InvalidShapeTypeException,
InvalidFieldNameException
obj - the ShapeObject to add
InvalidShapeTypeException - when obj's type differs from this
Shapefile's type
InvalidFieldNameException
public void removeShapeObject(int index)
throws java.lang.IndexOutOfBoundsException
index - the index of the ShapeObject to be removed
java.lang.IndexOutOfBoundsException - when the index is out of bounds
public com.nvs.shapefile.ShapeObject getShapeObject(int index)
throws java.lang.IndexOutOfBoundsException
index - the desired index as an int
java.lang.IndexOutOfBoundsException - when the index is out of boundspublic java.util.ArrayList getShapeObjects()
public void setShapeObjects(java.util.Collection collection)
throws InvalidShapeTypeException,
InvalidFieldNameException
collection - the ShapeObjects to be set as a collection
InvalidShapeTypeException - when a ShapeObject is added with a different
type than this Shapefile
InvalidFieldNameExceptionpublic com.nvs.shapefile.BoundingBox getBoundingBox()
public void setBoundingBox(com.nvs.shapefile.BoundingBox box)
box - the new bounding box of this Shapefilepublic void setTableDescription(com.nvs.shapefile.TableDescription tableDesc)
tableDesc - The new TableDescriptionpublic void computeExtents()
public com.nvs.shapefile.TableDescription getTableDescription()
public java.util.ArrayList getWarningMessages()
|
NVS Shapefile library Version 3.2 NVision Solutions, Inc. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||