src/test/java/de/blau/android/osm/RelationUtilTest.java
/**
     * Move tags from outer rings to relation test
     */
Move tags from outer rings to relation test
Move tags from outer rings to relation test
@Test
    public void moveOuterTagsTest() {
        StorageDelegator d = loadTestData(getClass());
        Way w1 = getWay(d, -1L);
        addTag(d, w1, Tags.KEY_BUILDING, Tags.VALUE_YES);
        Way w5 = getWay(d, -5L);
        addTag(d, w5, Tags.KEY_BUILDING, Tags.VALUE_YES);
        addTag(d, w5, Tags.KEY_BUILDING_PART, Tags.VALUE_YES);
        Way w4 = getWay(d, -4L);
        addTag(d, w4, Tags.KEY_LANDUSE, "grass");
        Way w10 = getWay(d, -10L);
        Relation mp = d.createAndInsertRelation(Arrays.asList(w1, w5, w4, w10));
        assertNotNull(mp);
        RelationUtils.setMultipolygonRoles(null, mp.getMembers(), false);
        assertFalse(mp.hasTags());
        d.setTags(mp, RelationUtils.addTypeTag(Tags.VALUE_MULTIPOLYGON, mp.getTags()));
        RelationUtils.moveOuterTags(d, mp);
        assertTrue(mp.hasTag(Tags.KEY_TYPE, Tags.VALUE_MULTIPOLYGON));
        assertTrue(mp.hasTag(Tags.KEY_BUILDING, Tags.VALUE_YES));
        assertFalse(w1.hasTags());
        assertTrue(w5.hasTag(Tags.KEY_BUILDING_PART, Tags.VALUE_YES));
        assertTrue(w4.hasTag(Tags.KEY_LANDUSE, "grass"));
    }
@ Test public void moveOuterTagsTest ( ) { StorageDelegator d = loadTestData ( getClass ( ) ) ; Way w1 = getWay ( d , - 1L ) ; addTag ( d , w1 , Tags . KEY_BUILDING , Tags . VALUE_YES ) ; Way w5 = getWay ( d , - 5L ) ; addTag ( d , w5 , Tags . KEY_BUILDING , Tags . VALUE_YES ) ; addTag ( d , w5 , Tags . KEY_BUILDING_PART , Tags . VALUE_YES ) ; Way w4 = getWay ( d , - 4L ) ; addTag ( d , w4 , Tags . KEY_LANDUSE , "grass" ) ; Way w10 = getWay ( d , - 10L ) ; Relation mp = d . createAndInsertRelation ( Arrays . asList ( w1 , w5 , w4 , w10 ) ) ; assertNotNull ( mp ) ; RelationUtils . setMultipolygonRoles ( null , mp . getMembers ( ) , false ) ; assertFalse ( mp . hasTags ( ) ) ; d . setTags ( mp , RelationUtils . addTypeTag ( Tags . VALUE_MULTIPOLYGON , mp . getTags ( ) ) ) ; RelationUtils . moveOuterTags ( d , mp ) ; assertTrue ( mp . hasTag ( Tags . KEY_TYPE , Tags . VALUE_MULTIPOLYGON ) ) ; assertTrue ( mp . hasTag ( Tags . KEY_BUILDING , Tags . VALUE_YES ) ) ; assertFalse ( w1 . hasTags ( ) ) ; assertTrue ( w5 . hasTag ( Tags . KEY_BUILDING_PART , Tags . VALUE_YES ) ) ; assertTrue ( w4 . hasTag ( Tags . KEY_LANDUSE , "grass" ) ) ; }
Move tags from outer rings to relation test
Move tags from outer rings to relation test