Search in sources :

Example 1 with OsmRelation

use of de.westnordost.osmapi.map.data.OsmRelation in project StreetComplete by westnordost.

the class RelationDaoTest method testPutGetNoTags.

public void testPutGetNoTags() {
    List<RelationMember> members = new ArrayList<>();
    members.add(new OsmRelationMember(0, "outer", Element.Type.WAY));
    members.add(new OsmRelationMember(1, "inner", Element.Type.WAY));
    Relation relation = new OsmRelation(5, 1, members, null);
    dao.put(relation);
    Relation dbRelation = dao.get(5);
    checkEqual(relation, dbRelation);
}
Also used : Relation(de.westnordost.osmapi.map.data.Relation) OsmRelation(de.westnordost.osmapi.map.data.OsmRelation) OsmRelationMember(de.westnordost.osmapi.map.data.OsmRelationMember) RelationMember(de.westnordost.osmapi.map.data.RelationMember) OsmRelation(de.westnordost.osmapi.map.data.OsmRelation) ArrayList(java.util.ArrayList) OsmRelationMember(de.westnordost.osmapi.map.data.OsmRelationMember)

Example 2 with OsmRelation

use of de.westnordost.osmapi.map.data.OsmRelation 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);
}
Also used : Relation(de.westnordost.osmapi.map.data.Relation) OsmRelation(de.westnordost.osmapi.map.data.OsmRelation) OsmRelationMember(de.westnordost.osmapi.map.data.OsmRelationMember) RelationMember(de.westnordost.osmapi.map.data.RelationMember) HashMap(java.util.HashMap) OsmRelation(de.westnordost.osmapi.map.data.OsmRelation) ArrayList(java.util.ArrayList) OsmRelationMember(de.westnordost.osmapi.map.data.OsmRelationMember)

Aggregations

OsmRelation (de.westnordost.osmapi.map.data.OsmRelation)2 OsmRelationMember (de.westnordost.osmapi.map.data.OsmRelationMember)2 Relation (de.westnordost.osmapi.map.data.Relation)2 RelationMember (de.westnordost.osmapi.map.data.RelationMember)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)1