Package org.locationtech.spatial4j.io
Class PolyshapeWriter
- java.lang.Object
-
- org.locationtech.spatial4j.io.PolyshapeWriter
-
- All Implemented Interfaces:
ShapeIO
,ShapeWriter
- Direct Known Subclasses:
JtsPolyshapeWriter
public class PolyshapeWriter extends Object implements ShapeWriter
Wrap the 'Encoded Polyline Algorithm Format' defined in: Google Maps API with flags to encode various Shapes: Point, Line, Polygon, etc For more details, see FORMATS.md This format works well for geographic shapes (-180...+180 / -90...+90), but is not appropriate for other coordinate systems- See Also:
- Google Maps API,
PolyshapeReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PolyshapeWriter.Encoder
Encodes a sequence of LatLngs into an encoded path string.
-
Field Summary
Fields Modifier and Type Field Description static char
KEY_ARG_END
static char
KEY_ARG_START
static char
KEY_BOX
static char
KEY_CIRCLE
static char
KEY_LINE
static char
KEY_MULTIPOINT
static char
KEY_POINT
static char
KEY_POLYGON
static char
KEY_SEPERATOR
-
Constructor Summary
Constructors Constructor Description PolyshapeWriter(SpatialContext ctx, SpatialContextFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getFormatName()
String
toString(Shape shape)
Write a shape to Stringvoid
write(Writer output, Shape shape)
Write a shape to the output writervoid
write(PolyshapeWriter.Encoder enc, Shape shape)
-
-
-
Field Detail
-
KEY_POINT
public static final char KEY_POINT
- See Also:
- Constant Field Values
-
KEY_LINE
public static final char KEY_LINE
- See Also:
- Constant Field Values
-
KEY_POLYGON
public static final char KEY_POLYGON
- See Also:
- Constant Field Values
-
KEY_MULTIPOINT
public static final char KEY_MULTIPOINT
- See Also:
- Constant Field Values
-
KEY_CIRCLE
public static final char KEY_CIRCLE
- See Also:
- Constant Field Values
-
KEY_BOX
public static final char KEY_BOX
- See Also:
- Constant Field Values
-
KEY_ARG_START
public static final char KEY_ARG_START
- See Also:
- Constant Field Values
-
KEY_ARG_END
public static final char KEY_ARG_END
- See Also:
- Constant Field Values
-
KEY_SEPERATOR
public static final char KEY_SEPERATOR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PolyshapeWriter
public PolyshapeWriter(SpatialContext ctx, SpatialContextFactory factory)
-
-
Method Detail
-
getFormatName
public String getFormatName()
- Specified by:
getFormatName
in interfaceShapeIO
- Returns:
- the format name
-
write
public void write(Writer output, Shape shape) throws IOException
Description copied from interface:ShapeWriter
Write a shape to the output writer- Specified by:
write
in interfaceShapeWriter
- Throws:
IOException
-
write
public void write(PolyshapeWriter.Encoder enc, Shape shape) throws IOException
- Throws:
IOException
-
toString
public String toString(Shape shape)
Description copied from interface:ShapeWriter
Write a shape to String- Specified by:
toString
in interfaceShapeWriter
-
-