fix issue 1164, processing address with identical street and street2 tag

This commit is contained in:
Pavol Zibrita 2012-07-17 04:41:19 +02:00
parent ba50378510
commit 9c1f73e2c6
3 changed files with 9 additions and 0 deletions

View file

@ -77,6 +77,11 @@ public class CachedDBStreetDAO extends DBStreetDAO
return addressBuildingLocalSet.contains(e.getId());
}
@Override
public boolean removeBuilding(Entity e) throws SQLException {
addressBuildingLocalSet.remove(e.getId());
return super.removeBuilding(e);
}
@Override
public boolean findStreetNode(Entity e) {
return addressStreetNodeLocalSet.contains(e.getId());

View file

@ -194,6 +194,7 @@ public class DBStreetDAO extends AbstractIndexPartCreator
}
public boolean removeBuilding(Entity e) throws SQLException {
executePendingPreparedStatements(); //ala flush
addressRemoveBuildingStat.setLong(1, e.getId());
boolean res = addressRemoveBuildingStat.execute();
commit();

View file

@ -742,8 +742,11 @@ public class IndexAddressCreator extends AbstractIndexPartCreator{
Building building2 = new Building(e);
building2.setName(hno.substring(secondNumber + 1));
Set<Long> ids2OfStreet = getStreetInCity(e.getIsInNames(), e.getTag(OSMTagKey.ADDR_STREET2), null, l);
ids2OfStreet.removeAll(idsOfStreet); //remove duplicated entries!
if(!ids2OfStreet.isEmpty()) {
streetDAO.writeBuilding(ids2OfStreet, building2);
} else {
building.setName2(building2.getName());
}
}
}