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 classPolyshapeWriter.EncoderEncodes a sequence of LatLngs into an encoded path string.
-
Field Summary
Fields Modifier and Type Field Description static charKEY_ARG_ENDstatic charKEY_ARG_STARTstatic charKEY_BOXstatic charKEY_CIRCLEstatic charKEY_LINEstatic charKEY_MULTIPOINTstatic charKEY_POINTstatic charKEY_POLYGONstatic charKEY_SEPERATOR
-
Constructor Summary
Constructors Constructor Description PolyshapeWriter(SpatialContext ctx, SpatialContextFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetFormatName()StringtoString(Shape shape)Write a shape to Stringvoidwrite(Writer output, Shape shape)Write a shape to the output writervoidwrite(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:
getFormatNamein interfaceShapeIO- Returns:
- the format name
-
write
public void write(Writer output, Shape shape) throws IOException
Description copied from interface:ShapeWriterWrite a shape to the output writer- Specified by:
writein 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:ShapeWriterWrite a shape to String- Specified by:
toStringin interfaceShapeWriter
-
-