Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for house numbers without street (addr:place schema) #54

Merged
merged 2 commits into from May 1, 2013

Conversation

lonvia
Copy link
Member

@lonvia lonvia commented Apr 28, 2013

This is a proposal to add support for addr:place by adding a new column 'addr_place' which works just like the 'street' column. A house number is simply interpreted as attachable to a street or a place (currently up to search rank 16) according to which of the two columns is not NULL. The search algorithm can remain unmodified. Requires some modifications of osm2pgsql.

Works nicely with the Polish addr:place system, needs minimal modifications, can be adopted without reimport and has almost no overhead. Figures for planet import:

Import time: 2165 min (-43 min)
DB size: 524 GB ( +4 GB)

Downside is that I don't know how to make it work with the conscription number system without resorting to some ugly hacks. The whole double addressing idea probably requires to duplicate the housenumber column as well and possibly also parent_place_id, which in turn would have more severe implications for the front end.

@twain47
Copy link
Collaborator

twain47 commented Apr 29, 2013

It seems like a significant improvement with no obvious down side.

I have a slight worry about the performance effect of the change to search.php but hopefully it is minor.

@lonvia
Copy link
Member Author

lonvia commented Apr 30, 2013

Alright, let's merge this in then and worry about conscription numbers later.

There were still some issues with correct invalidation when parent objects are updated. Should be fixed now, updates are doing fine. I've also applied the change of search.php to the OSM instance and couldn't see any impact on performance. Still need to make sure that the DB migration actually works. I'll merge once those tests have passed.

@lonvia lonvia merged commit e55abf8 into osm-search:master May 1, 2013
@lonvia
Copy link
Member Author

lonvia commented May 1, 2013

Merged.

To migrate existing DBs run (with updates disabled):

ALTER TABLE place ADD COLUMN addr_place TEXT;
ALTER TABLE placex ADD COLUMN addr_place TEXT;

To also update any existing street-less addresses in the DB get all appropriately tagged data from the Overpass API using this query and import into your DB with ./utils/update.php --import file <placefile> --index.

@lonvia lonvia deleted the place-housenumbers branch May 1, 2013 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants