public class Shapefile
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ARC |
static int |
ARCM |
static int |
ARCZ |
private java.net.URL |
baseURL |
private EndianDataInputStream |
file |
private GeometryFactory |
geomFactory |
private ShapeHandler |
handler |
private ShapefileHeader |
mainHeader |
static int |
MULTIPOINT |
static int |
MULTIPOINTM |
static int |
MULTIPOINTZ |
private java.io.InputStream |
myInputStream |
static int |
NULL |
static int |
POINT |
static int |
POINTM |
static int |
POINTZ |
static int |
POLYGON |
static int |
POLYGONM |
static int |
POLYGONZ |
private int |
recordNumber |
(package private) static int |
SHAPEFILE_ID |
static int |
UNDEFINED |
(package private) static int |
VERSION |
static int |
XY |
static int |
XYM |
static int |
XYZM |
Constructor and Description |
---|
Shapefile(java.io.InputStream IS) |
Shapefile(java.net.URL url)
Creates and initialises a shapefile from a url
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
private EndianDataInputStream |
getInputStream() |
static ShapeHandler |
getShapeHandler(Geometry geom,
int ShapeFileDimentions) |
static ShapeHandler |
getShapeHandler(int type) |
static int |
getShapeType(Geometry geom,
int coordDimension) |
static java.lang.String |
getShapeTypeDescription(int index)
Returns a string for the shape type of index.
|
Geometry |
next()
Returns the next geometry in the shapefile stream
|
GeometryCollection |
read(GeometryFactory geometryFactory)
Initialises a shapefile from disk.
|
void |
readIndex(java.io.InputStream is) |
void |
readStream(GeometryFactory geometryFactory)
Initialises a shapefile from disk.
|
static final int SHAPEFILE_ID
static final int VERSION
public static final int NULL
public static final int POINT
public static final int POINTZ
public static final int POINTM
public static final int ARC
public static final int ARCM
public static final int ARCZ
public static final int POLYGON
public static final int POLYGONM
public static final int POLYGONZ
public static final int MULTIPOINT
public static final int MULTIPOINTM
public static final int MULTIPOINTZ
public static final int UNDEFINED
public static final int XY
public static final int XYM
public static final int XYZM
private java.net.URL baseURL
private java.io.InputStream myInputStream
private GeometryFactory geomFactory
private EndianDataInputStream file
private ShapefileHeader mainHeader
private ShapeHandler handler
private int recordNumber
public Shapefile(java.net.URL url)
url
- The url of the shapefilepublic Shapefile(java.io.InputStream IS)
private EndianDataInputStream getInputStream() throws java.io.IOException
java.io.IOException
public GeometryCollection read(GeometryFactory geometryFactory) throws java.io.IOException, ShapefileException, java.lang.Exception
java.io.IOException
ShapefileException
java.lang.Exception
public void readStream(GeometryFactory geometryFactory) throws java.io.IOException, ShapefileException, java.lang.Exception
java.io.IOException
ShapefileException
java.lang.Exception
public Geometry next() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public static java.lang.String getShapeTypeDescription(int index)
index
- An int coresponding to the shape type to be describedpublic static ShapeHandler getShapeHandler(Geometry geom, int ShapeFileDimentions) throws java.lang.Exception
java.lang.Exception
public static ShapeHandler getShapeHandler(int type) throws java.lang.Exception
java.lang.Exception
public static int getShapeType(Geometry geom, int coordDimension) throws ShapefileException
ShapefileException
public void readIndex(java.io.InputStream is) throws java.io.IOException
java.io.IOException