Package org.openstreetmap.josm.io
Class GeoJSONWriter.GeometryPrimitiveVisitor
java.lang.Object
org.openstreetmap.josm.io.GeoJSONWriter.GeometryPrimitiveVisitor
- All Implemented Interfaces:
OsmPrimitiveVisitor
- Enclosing class:
- GeoJSONWriter
Convert a primitive to a json object
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate jakarta.json.JsonArrayBuildergetCoorsArray(Iterable<Node> nodes) voidVisiting call for points.voidVisiting call for relations.voidVisiting call for lines.private voidVisit a multi-part geometry.private voidVisit a relation that is a multi line stringprivate voidVisit a relation that only contains pointsprivate voidConvert a multipolygon to geojson
-
Field Details
-
geomObj
-
-
Constructor Details
-
GeometryPrimitiveVisitor
GeometryPrimitiveVisitor(jakarta.json.JsonObjectBuilder geomObj)
-
-
Method Details
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for points.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
n- The node to inspect.
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for lines.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
w- The way to inspect.
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for relations.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
r- The relation to inspect.
-
visitMultiGeometry
Visit a multi-part geometry. Note: Does not currently recurse down relations. RFC 7946 indicates that we should avoid nested geometry collections. This behavior may change any time in the future!- Parameters:
r- The relation to visit.
-
visitMultiPoints
Visit a relation that only contains points- Parameters:
r- The relation to visit
-
visitMultiLineString
Visit a relation that is a multi line string- Parameters:
r- The relation to convert
-
visitMultipolygon
private void visitMultipolygon(Relation r) throws MultipolygonBuilder.JoinedPolygonCreationException Convert a multipolygon to geojson- Parameters:
r- The relation to convert- Throws:
MultipolygonBuilder.JoinedPolygonCreationException- SeeMultipolygonBuilder.joinWays(Relation). Note that if the exception is thrown,geomObjwill not have been modified.
-
getCoorsArray
-