Package org.locationtech.spatial4j.io
Interface ShapeReader
-
- All Superinterfaces:
ShapeIO
- All Known Implementing Classes:
GeoJSONReader,LegacyShapeReader,PolyshapeReader,WKTReader
public interface ShapeReader extends ShapeIO
Implementations are expected to be thread safe
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Shaperead(Reader reader)Read aShapefrom the reader.Shaperead(Object value)ShapereadIfSupported(Object value)-
Methods inherited from interface org.locationtech.spatial4j.io.ShapeIO
getFormatName
-
-
-
-
Method Detail
-
read
Shape read(Object value) throws IOException, ParseException, InvalidShapeException
- Parameters:
value- -- the input value, could be a String or other object- Returns:
- a shape valid shape (not null)
- Throws:
IOExceptionParseExceptionInvalidShapeException
-
readIfSupported
Shape readIfSupported(Object value) throws InvalidShapeException
- 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
Shape read(Reader reader) throws IOException, ParseException, InvalidShapeException
Read aShapefrom the reader.- Parameters:
reader- -- the input. Note, it will not be closed by this function- Returns:
- a valid Shape (never null)
- Throws:
IOExceptionParseExceptionInvalidShapeException
-
-