use of de.westnordost.osmapi.map.data.Relation in project StreetComplete by westnordost.
the class OverpassMapDataParser method onEndElement.
@Override
protected void onEndElement() {
String name = getName();
Element element = null;
ElementGeometry geometry = null;
switch(name) {
case MEMBER:
wayNodes = null;
break;
case NODE:
Node node = factory.createNode(id, version, lat, lon, tags, null, null);
geometry = elementGeometryCreator.create(node);
element = node;
break;
case WAY:
Way way = factory.createWay(id, version, nodes, tags, null, null);
geometry = elementGeometryCreator.create(way);
element = way;
nodes = null;
nodePositionsByWay = null;
wayNodes = null;
break;
case RELATION:
Relation relation = factory.createRelation(id, version, members, tags, null, null);
geometry = elementGeometryCreator.create(relation);
element = relation;
members = null;
nodePositionsByWay = null;
break;
}
if (element != null) {
tags = null;
handler.handle(element, geometry);
}
}
use of de.westnordost.osmapi.map.data.Relation in project StreetComplete by westnordost.
the class RelationDaoTest method testPutGetWithTags.
public void testPutGetWithTags() {
List<RelationMember> members = new ArrayList<>();
members.add(new OsmRelationMember(0, "outer", Element.Type.WAY));
members.add(new OsmRelationMember(1, "inner", Element.Type.WAY));
Map<String, String> tags = new HashMap<>();
tags.put("a key", "a value");
Relation relation = new OsmRelation(5, 1, members, tags);
dao.put(relation);
Relation dbRelation = dao.get(5);
checkEqual(relation, dbRelation);
}
Aggregations