@Test public void TestAttchingNoSidewalkRemovesAnyAlreadyAttachedORSSidewalkTags() { ReaderWay way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.NONE); assertFalse(way.hasTag("ors-sidewalk-side")); way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.LEFT); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.NONE); assertFalse(way.hasTag("ors-sidewalk-side")); }
public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; }  }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; }  ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; }  ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); static final String KEY_ORS_SIDEWALK_SIDE; static final String VAL_RIGHT; static final String VAL_LEFT; }