Package org.locationtech.spatial4j.io
Class PolyshapeReader
- java.lang.Object
-
- org.locationtech.spatial4j.io.PolyshapeReader
-
- All Implemented Interfaces:
ShapeIO,ShapeReader
public class PolyshapeReader extends Object implements ShapeReader
- See Also:
PolyshapeWriter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPolyshapeReader.XReaderfrom Apache 2.0 licensed: https://github.com/googlemaps/android-maps-utils/blob/master/library/src/com/google/maps/android/PolyUtil.java
-
Constructor Summary
Constructors Constructor Description PolyshapeReader(SpatialContext ctx, SpatialContextFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetFormatName()Shaperead(Reader r)Read aShapefrom the reader.Shaperead(Object value)ShapereadIfSupported(Object value)protected ShapereadPolygon(PolyshapeReader.XReader reader)
-
-
-
Constructor Detail
-
PolyshapeReader
public PolyshapeReader(SpatialContext ctx, SpatialContextFactory factory)
-
-
Method Detail
-
getFormatName
public String getFormatName()
- Specified by:
getFormatNamein interfaceShapeIO- Returns:
- the format name
-
read
public Shape read(Object value) throws IOException, ParseException, InvalidShapeException
- Specified by:
readin interfaceShapeReader- Parameters:
value- -- the input value, could be a String or other object- Returns:
- a shape valid shape (not null)
- Throws:
IOExceptionParseExceptionInvalidShapeException
-
readIfSupported
public Shape readIfSupported(Object value) throws InvalidShapeException
- Specified by:
readIfSupportedin interfaceShapeReader- Parameters:
value- -- the input value, could be a String or other object- Returns:
- a shape or null, if the input was un readable.
This will throw
InvalidShapeExceptionwhen we could read a shape, but it was invalid - Throws:
InvalidShapeException
-
read
public final Shape read(Reader r) throws ParseException, IOException
Description copied from interface:ShapeReaderRead aShapefrom the reader.- Specified by:
readin interfaceShapeReader- Parameters:
r- -- the input. Note, it will not be closed by this function- Returns:
- a valid Shape (never null)
- Throws:
ParseExceptionIOException
-
readPolygon
protected Shape readPolygon(PolyshapeReader.XReader reader) throws IOException
- Throws:
IOException
-
-