Class Shapefile
java.lang.Object
org.locationtech.jtstest.testbuilder.io.shapefile.Shapefile
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
private URL
private EndianDataInputStream
private GeometryFactory
private ShapeHandler
private ShapefileHeader
static final int
static final int
static final int
private InputStream
static final int
static final int
static final int
static final int
static final int
static final int
static final int
private int
(package private) static final int
static final int
(package private) static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private EndianDataInputStream
static ShapeHandler
getShapeHandler
(int type) static ShapeHandler
getShapeHandler
(Geometry geom, int ShapeFileDimentions) static int
getShapeType
(Geometry geom, int coordDimension) static String
getShapeTypeDescription
(int index) Returns a string for the shape type of index.next()
Returns the next geometry in the shapefile streamread
(GeometryFactory geometryFactory) Initialises a shapefile from disk.void
readIndex
(InputStream is) void
readStream
(GeometryFactory geometryFactory) Initialises a shapefile from disk.
-
Field Details
-
SHAPEFILE_ID
static final int SHAPEFILE_ID- See Also:
-
VERSION
static final int VERSION- See Also:
-
NULL
public static final int NULL- See Also:
-
POINT
public static final int POINT- See Also:
-
POINTZ
public static final int POINTZ- See Also:
-
POINTM
public static final int POINTM- See Also:
-
ARC
public static final int ARC- See Also:
-
ARCM
public static final int ARCM- See Also:
-
ARCZ
public static final int ARCZ- See Also:
-
POLYGON
public static final int POLYGON- See Also:
-
POLYGONM
public static final int POLYGONM- See Also:
-
POLYGONZ
public static final int POLYGONZ- See Also:
-
MULTIPOINT
public static final int MULTIPOINT- See Also:
-
MULTIPOINTM
public static final int MULTIPOINTM- See Also:
-
MULTIPOINTZ
public static final int MULTIPOINTZ- See Also:
-
UNDEFINED
public static final int UNDEFINED- See Also:
-
XY
public static final int XY- See Also:
-
XYM
public static final int XYM- See Also:
-
XYZM
public static final int XYZM- See Also:
-
baseURL
-
myInputStream
-
geomFactory
-
file
-
mainHeader
-
handler
-
recordNumber
private int recordNumber
-
-
Constructor Details
-
Shapefile
Creates and initialises a shapefile from a url- Parameters:
url
- The url of the shapefile
-
Shapefile
-
-
Method Details
-
getInputStream
- Throws:
IOException
-
read
public GeometryCollection read(GeometryFactory geometryFactory) throws IOException, ShapefileException, Exception Initialises a shapefile from disk. Use Shapefile(String) if you don't want to use LEDataInputStream directly (recomened)- Throws:
IOException
ShapefileException
Exception
-
readStream
public void readStream(GeometryFactory geometryFactory) throws IOException, ShapefileException, Exception Initialises a shapefile from disk. Use Shapefile(String) if you don't want to use LEDataInputStream directly (recomened)- Throws:
IOException
ShapefileException
Exception
-
next
Returns the next geometry in the shapefile stream- Returns:
- null at EOF
- Throws:
IOException
-
close
- Throws:
IOException
-
getShapeTypeDescription
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
- Throws:
Exception
-
getShapeHandler
- Throws:
Exception
-
getShapeType
- Throws:
ShapefileException
-
readIndex
- Throws:
IOException
-