Add address index for street2

This commit is contained in:
Victor Shcherb 2012-07-08 22:37:35 +02:00
parent d715f1317f
commit 02a44e0a27
2 changed files with 13 additions and 1 deletions

View file

@ -740,7 +740,18 @@ public class IndexAddressCreator extends AbstractIndexPartCreator{
building.setName(hno.substring(0, i));
building.setName2(hno.substring(i + 1));
} else {
int secondNumber = hno.indexOf('/');
if(secondNumber == -1 || !(secondNumber < hno.length() - 1)) {
building.setName(hno);
} else {
building.setName(hno.substring(0, secondNumber));
Building building2 = new Building(e);
building2.setName(hno.substring(secondNumber + 1));
Set<Long> ids2OfStreet = getStreetInCity(e.getIsInNames(), e.getTag(OSMTagKey.ADDR_STREET2), null, l);
if(!ids2OfStreet.isEmpty()) {
streetDAO.writeBuilding(ids2OfStreet, building2);
}
}
}
streetDAO.writeBuilding(idsOfStreet, building);

View file

@ -29,6 +29,7 @@ public class OSMSettings {
PLACE("place"), //$NON-NLS-1$
ADDR_HOUSE_NUMBER("addr:housenumber"), //$NON-NLS-1$
ADDR_STREET("addr:street"), //$NON-NLS-1$
ADDR_STREET2("addr:street2"), //$NON-NLS-1$
ADDR_CITY("addr:city"), //$NON-NLS-1$
ADDR_POSTCODE("addr:postcode"), //$NON-NLS-1$
ADDR_INTERPOLATION("addr:interpolation"), //$NON-NLS-1$