/** * A method that creates properties for a GeoJSON Feature from the tags. * * @return A GeoJSON properties object that is to be put in a Feature. */ public JsonObject geoJsonProperties() { final JsonObject properties = new JsonObject(); getTags().forEach(properties::addProperty); properties.addProperty(GeoJsonUtils.IDENTIFIER, getIdentifier()); properties.addProperty(GeoJsonUtils.OSM_IDENTIFIER, getOsmIdentifier()); properties.addProperty(GeoJsonUtils.ITEM_TYPE, String.valueOf(getType())); final Optional<String> shardName = getAtlas().metaData().getShardName(); shardName.ifPresent(shard -> properties.addProperty("shard", shard)); final Set<Relation> relations = relations(); if (relations.size() > 0) { final JsonArray relationsArray = new JsonArray(); properties.add("relations", relationsArray); for (final Relation relation : relations) { final JsonObject relationObject = relation.geoJsonProperties(); relationsArray.add(relationObject); } } return properties; }
@Override public JsonObject asGeoJsonGeometry() final JsonObject properties = geoJsonProperties();