Class Shapefile
- java.lang.Object
-
- org.locationtech.jtstest.testbuilder.io.shapefile.Shapefile
-
public class Shapefile extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intARCstatic intARCMstatic intARCZstatic intMULTIPOINTstatic intMULTIPOINTMstatic intMULTIPOINTZstatic intNULLstatic intPOINTstatic intPOINTMstatic intPOINTZstatic intPOLYGONstatic intPOLYGONMstatic intPOLYGONZstatic intUNDEFINEDstatic intXYstatic intXYMstatic intXYZM
-
Constructor Summary
Constructors Constructor Description Shapefile(InputStream IS)Shapefile(URL url)Creates and initialises a shapefile from a url
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static ShapeHandlergetShapeHandler(int type)static ShapeHandlergetShapeHandler(Geometry geom, int ShapeFileDimentions)static intgetShapeType(Geometry geom, int coordDimension)static StringgetShapeTypeDescription(int index)Returns a string for the shape type of index.Geometrynext()Returns the next geometry in the shapefile streamGeometryCollectionread(GeometryFactory geometryFactory)Initialises a shapefile from disk.voidreadIndex(InputStream is)voidreadStream(GeometryFactory geometryFactory)Initialises a shapefile from disk.
-
-
-
Field Detail
-
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
-
-
Constructor Detail
-
Shapefile
public Shapefile(URL url)
Creates and initialises a shapefile from a url- Parameters:
url- The url of the shapefile
-
Shapefile
public Shapefile(InputStream IS)
-
-
Method Detail
-
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:
IOExceptionShapefileExceptionException
-
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:
IOExceptionShapefileExceptionException
-
next
public Geometry next() throws IOException
Returns the next geometry in the shapefile stream- Returns:
- null at EOF
- Throws:
IOException
-
close
public void close() throws IOException- Throws:
IOException
-
getShapeTypeDescription
public static 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 Exception
- Throws:
Exception
-
getShapeHandler
public static ShapeHandler getShapeHandler(int type) throws Exception
- Throws:
Exception
-
getShapeType
public static int getShapeType(Geometry geom, int coordDimension) throws ShapefileException
- Throws:
ShapefileException
-
readIndex
public void readIndex(InputStream is) throws IOException
- Throws:
IOException
-
-