public class GeoJSONWriter extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
GeoJSONWriter.GeometryPrimitiveVisitor |
Modifier and Type | Field and Description |
---|---|
private DataSet |
data |
private static java.util.Set<Way> |
processedMultipolygonWays |
private Projection |
projection |
private static BooleanProperty |
SKIP_EMPTY_NODES |
private static BooleanProperty |
UNTAGGED_CLOSED_IS_POLYGON |
Constructor and Description |
---|
GeoJSONWriter(DataSet ds)
Constructs a new
GeoJSONWriter . |
Modifier and Type | Method and Description |
---|---|
protected void |
appendBounds(Bounds b,
javax.json.JsonObjectBuilder object) |
protected void |
appendLayerBounds(DataSet ds,
javax.json.JsonObjectBuilder object) |
protected void |
appendLayerFeatures(DataSet ds,
javax.json.JsonObjectBuilder object) |
protected void |
appendPrimitive(OsmPrimitive p,
javax.json.JsonArrayBuilder array) |
private static javax.json.JsonArrayBuilder |
getCoorArray(javax.json.JsonArrayBuilder builder,
EastNorth c) |
private javax.json.JsonArrayBuilder |
getCoorArray(javax.json.JsonArrayBuilder builder,
LatLon c) |
java.lang.String |
write()
Writes OSM data as a GeoJSON string (prettified).
|
java.lang.String |
write(boolean pretty)
Writes OSM data as a GeoJSON string (prettified or not).
|
private final Projection projection
private static final BooleanProperty SKIP_EMPTY_NODES
private static final BooleanProperty UNTAGGED_CLOSED_IS_POLYGON
private static final java.util.Set<Way> processedMultipolygonWays
public GeoJSONWriter(DataSet ds)
GeoJSONWriter
.ds
- The OSM data set to savepublic java.lang.String write()
public java.lang.String write(boolean pretty)
pretty
- true
to have pretty output, false
otherwiseprivate javax.json.JsonArrayBuilder getCoorArray(javax.json.JsonArrayBuilder builder, LatLon c)
private static javax.json.JsonArrayBuilder getCoorArray(javax.json.JsonArrayBuilder builder, EastNorth c)
protected void appendPrimitive(OsmPrimitive p, javax.json.JsonArrayBuilder array)
protected void appendLayerBounds(DataSet ds, javax.json.JsonObjectBuilder object)
protected void appendBounds(Bounds b, javax.json.JsonObjectBuilder object)
protected void appendLayerFeatures(DataSet ds, javax.json.JsonObjectBuilder object)