Package org.locationtech.spatial4j.io
Class LegacyShapeReader
java.lang.Object
org.locationtech.spatial4j.io.LegacyShapeReader
- All Implemented Interfaces:
ShapeIO
,ShapeReader
Deprecated.
Reads a shape from the old format.
- Point: X Y
1.23 4.56 - Rect: XMin YMin XMax YMax
1.23 4.56 7.87 4.56 - {CIRCLE} '(' {POINT} {DISTANCE} ')'
CIRCLE is "CIRCLE" or "Circle" (no other case), and POINT is "X Y" order pair of doubles, or "Y,X" (lat,lon) pair of doubles, and DISTANCE is "d=RADIUS" or "distance=RADIUS" where RADIUS is a double that is the distance radius in degrees.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLegacyShapeReader
(SpatialContext ctx, SpatialContextFactory factory) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Deprecated.Read aShape
from the reader.Deprecated.readIfSupported
(Object value) Deprecated.private static Point
readLatCommaLonPoint
(String value, SpatialContext ctx) Deprecated.Reads geospatial latitude then a comma then longitude.static Shape
readShapeOrNull
(String str, SpatialContext ctx) Deprecated.Reads the shape specification as defined in the class javadocs.
-
Field Details
-
ctx
Deprecated.
-
-
Constructor Details
-
LegacyShapeReader
Deprecated.
-
-
Method Details
-
readShapeOrNull
Deprecated.Reads the shape specification as defined in the class javadocs. If the first character is a letter but it doesn't complete out "Circle" or "CIRCLE" then this method returns null, offering the caller the opportunity to potentially try additional parsing. If the first character is not a letter then it's assumed to be a point or rectangle. If that doesn't work out then anInvalidShapeException
is thrown.- Throws:
InvalidShapeException
-
readLatCommaLonPoint
private static Point readLatCommaLonPoint(String value, SpatialContext ctx) throws InvalidShapeException Deprecated.Reads geospatial latitude then a comma then longitude.- Throws:
InvalidShapeException
-
getFormatName
Deprecated.- Specified by:
getFormatName
in interfaceShapeIO
- Returns:
- the format name
-
read
Deprecated.- Specified by:
read
in interfaceShapeReader
- Parameters:
value
- -- the input value, could be a String or other object- Returns:
- a shape valid shape (not null)
- Throws:
IOException
ParseException
InvalidShapeException
-
readIfSupported
Deprecated.- Specified by:
readIfSupported
in 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
InvalidShapeException
when we could read a shape, but it was invalid - Throws:
InvalidShapeException
-
read
Deprecated.Description copied from interface:ShapeReader
Read aShape
from the reader.- Specified by:
read
in interfaceShapeReader
- Parameters:
reader
- -- the input. Note, it will not be closed by this function- Returns:
- a valid Shape (never null)
- Throws:
IOException
ParseException
InvalidShapeException
-