public class GeoJSONReader extends Object implements ShapeReader
| Modifier and Type | Field and Description |
|---|---|
protected static String |
BUFFER |
protected static String |
BUFFER_UNITS |
protected SpatialContext |
ctx |
protected ShapeFactory |
shapeFactory |
| Constructor and Description |
|---|
GeoJSONReader(SpatialContext ctx,
SpatialContextFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
String |
getFormatName() |
Shape |
read(Object value) |
Shape |
read(Reader reader)
Read a
Shape from the reader. |
protected Circle |
readCircle(org.noggit.JSONParser parser) |
protected void |
readCoordListXYZ(org.noggit.JSONParser parser,
ShapeFactory.PointsBuilder pointsBuilder) |
protected void |
readCoordXYZ(org.noggit.JSONParser parser,
ShapeFactory.PointsBuilder pointsBuilder) |
protected double |
readDistance(String distProperty,
String distUnitsProperty,
org.noggit.JSONParser parser)
Helper method to read a up until a distance value (radius, buffer) and it's corresponding unit are found.
|
Shape |
readIfSupported(Object value) |
protected Shape |
readLineString(org.noggit.JSONParser parser) |
protected Shape |
readMultiLineString(org.noggit.JSONParser parser) |
protected Shape |
readMultiPoint(org.noggit.JSONParser parser) |
protected Shape |
readMultiPolygon(org.noggit.JSONParser parser) |
protected Shape |
readPoint(org.noggit.JSONParser parser) |
protected ShapeFactory.PolygonBuilder |
readPolygon(org.noggit.JSONParser parser,
ShapeFactory.PolygonBuilder polygonBuilder) |
protected Shape |
readShape(org.noggit.JSONParser parser) |
protected Shape |
readShapeFromCoordinates(String type,
org.noggit.JSONParser parser) |
protected void |
readUntilEvent(org.noggit.JSONParser parser,
int event) |
protected static final String BUFFER
protected static final String BUFFER_UNITS
protected final SpatialContext ctx
protected final ShapeFactory shapeFactory
public GeoJSONReader(SpatialContext ctx, SpatialContextFactory factory)
public String getFormatName()
getFormatName in interface ShapeIOpublic final Shape read(Reader reader) throws IOException, ParseException
ShapeReaderShape from the reader.read in interface ShapeReaderreader - -- the input. Note, it will not be closed by this functionIOExceptionParseExceptionpublic Shape read(Object value) throws IOException, ParseException, InvalidShapeException
read in interface ShapeReadervalue - -- the input value, could be a String or other objectIOExceptionParseExceptionInvalidShapeExceptionpublic Shape readIfSupported(Object value) throws InvalidShapeException
readIfSupported in interface ShapeReadervalue - -- the input value, could be a String or other objectInvalidShapeException when we could read a shape, but it was
invalidInvalidShapeExceptionprotected void readCoordXYZ(org.noggit.JSONParser parser,
ShapeFactory.PointsBuilder pointsBuilder)
throws IOException,
ParseException
IOExceptionParseExceptionprotected void readCoordListXYZ(org.noggit.JSONParser parser,
ShapeFactory.PointsBuilder pointsBuilder)
throws IOException,
ParseException
IOExceptionParseExceptionprotected void readUntilEvent(org.noggit.JSONParser parser,
int event)
throws IOException
IOExceptionprotected Shape readPoint(org.noggit.JSONParser parser) throws IOException, ParseException
IOExceptionParseExceptionprotected Shape readLineString(org.noggit.JSONParser parser) throws IOException, ParseException
IOExceptionParseExceptionprotected Circle readCircle(org.noggit.JSONParser parser) throws IOException, ParseException
IOExceptionParseExceptionprotected double readDistance(String distProperty, String distUnitsProperty, org.noggit.JSONParser parser) throws IOException
This method returns 0 if no distance value is found. This method currently only handles distance units of "km".
distProperty - The name of the property containing the distance value.distUnitsProperty - The name of the property containing the distance unit.IOExceptionprotected Shape readShape(org.noggit.JSONParser parser) throws IOException, ParseException
IOExceptionParseExceptionprotected Shape readShapeFromCoordinates(String type, org.noggit.JSONParser parser) throws IOException, ParseException
IOExceptionParseExceptionprotected ShapeFactory.PolygonBuilder readPolygon(org.noggit.JSONParser parser, ShapeFactory.PolygonBuilder polygonBuilder) throws IOException, ParseException
IOExceptionParseExceptionprotected Shape readMultiPoint(org.noggit.JSONParser parser) throws IOException, ParseException
IOExceptionParseExceptionprotected Shape readMultiLineString(org.noggit.JSONParser parser) throws IOException, ParseException
IOExceptionParseExceptionprotected Shape readMultiPolygon(org.noggit.JSONParser parser) throws IOException, ParseException
IOExceptionParseExceptionCopyright © 2025 LocationTech. All rights reserved.