Class Shapefile
- java.lang.Object
-
- org.locationtech.jtstest.testbuilder.io.shapefile.Shapefile
-
public class Shapefile extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field 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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
private EndianDataInputStream
getInputStream()
static ShapeHandler
getShapeHandler(int type)
static ShapeHandler
getShapeHandler(Geometry geom, int ShapeFileDimentions)
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 streamGeometryCollection
read(GeometryFactory geometryFactory)
Initialises a shapefile from disk.void
readIndex(java.io.InputStream is)
void
readStream(GeometryFactory geometryFactory)
Initialises a shapefile from disk.
-
-
-
Field Detail
-
SHAPEFILE_ID
static final int SHAPEFILE_ID
- See Also:
- Constant Field Values
-
VERSION
static final int VERSION
- See Also:
- Constant Field Values
-
NULL
public static final int NULL
- See Also:
- Constant Field Values
-
POINT
public static final int POINT
- See Also:
- Constant Field Values
-
POINTZ
public static final int POINTZ
- See Also:
- Constant Field Values
-
POINTM
public static final int POINTM
- See Also:
- Constant Field Values
-
ARC
public static final int ARC
- See Also:
- Constant Field Values
-
ARCM
public static final int ARCM
- See Also:
- Constant Field Values
-
ARCZ
public static final int ARCZ
- See Also:
- Constant Field Values
-
POLYGON
public static final int POLYGON
- See Also:
- Constant Field Values
-
POLYGONM
public static final int POLYGONM
- See Also:
- Constant Field Values
-
POLYGONZ
public static final int POLYGONZ
- See Also:
- Constant Field Values
-
MULTIPOINT
public static final int MULTIPOINT
- See Also:
- Constant Field Values
-
MULTIPOINTM
public static final int MULTIPOINTM
- See Also:
- Constant Field Values
-
MULTIPOINTZ
public static final int MULTIPOINTZ
- See Also:
- Constant Field Values
-
UNDEFINED
public static final int UNDEFINED
- See Also:
- Constant Field Values
-
XY
public static final int XY
- See Also:
- Constant Field Values
-
XYM
public static final int XYM
- See Also:
- Constant Field Values
-
XYZM
public static final int XYZM
- See Also:
- Constant Field Values
-
baseURL
private java.net.URL baseURL
-
myInputStream
private java.io.InputStream myInputStream
-
geomFactory
private GeometryFactory geomFactory
-
file
private EndianDataInputStream file
-
mainHeader
private ShapefileHeader mainHeader
-
handler
private ShapeHandler handler
-
recordNumber
private int recordNumber
-
-
Method Detail
-
getInputStream
private EndianDataInputStream getInputStream() throws java.io.IOException
- Throws:
java.io.IOException
-
read
public GeometryCollection read(GeometryFactory geometryFactory) throws java.io.IOException, ShapefileException, java.lang.Exception
Initialises a shapefile from disk. Use Shapefile(String) if you don't want to use LEDataInputStream directly (recomened)- Throws:
java.io.IOException
ShapefileException
java.lang.Exception
-
readStream
public void readStream(GeometryFactory geometryFactory) throws java.io.IOException, ShapefileException, java.lang.Exception
Initialises a shapefile from disk. Use Shapefile(String) if you don't want to use LEDataInputStream directly (recomened)- Throws:
java.io.IOException
ShapefileException
java.lang.Exception
-
next
public Geometry next() throws java.io.IOException
Returns the next geometry in the shapefile stream- Returns:
- null at EOF
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
getShapeTypeDescription
public static java.lang.String getShapeTypeDescription(int index)
Returns a string for the shape type of index.- Parameters:
index
- An int coresponding to the shape type to be described- Returns:
- A string descibing the shape type
-
getShapeHandler
public static ShapeHandler getShapeHandler(Geometry geom, int ShapeFileDimentions) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getShapeHandler
public static ShapeHandler getShapeHandler(int type) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getShapeType
public static int getShapeType(Geometry geom, int coordDimension) throws ShapefileException
- Throws:
ShapefileException
-
readIndex
public void readIndex(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
-