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

during reverse geocode lookup we also check the (optional) Tiger data #268

Merged
merged 3 commits into from Apr 30, 2015
Merged

during reverse geocode lookup we also check the (optional) Tiger data #268

merged 3 commits into from Apr 30, 2015

Conversation

mtmail
Copy link
Collaborator

@mtmail mtmail commented Apr 28, 2015

When we don't find a result with rank 30 (building name, house number etc) but find a road, then inside the US we also check the nearest Tiger house numbers who have the street as parent.

The osm_type is 'T' and the osm_id is the place_id. Not entirely sure if that makes sense but Geocode.php sets the same.

In PlaceLookup.php right after if ($this->bIsTiger) it would be possible to use a UNION to combine both SQL queries. But since it's a direct lookup by place_id and we already know the place is a Tiger place a single query is enough.

I've setup a server at http://46.101.149.108:9876/nominatim were you can test the results. For example http://46.101.149.108:9876/nominatim/reverse.php?format=xml&lat=40.6859534063625&lon=-112.055149368461 which will return 6882, Kings Estate Drive, West Valley City, Salt Lake County, 84128, United States of America.

The server has only data loaded for the Salt Lake City, Utah area. See the bounding box on http://bboxfinder.com/#40.310949,-112.376404,41.391234,-111.549683

This feature got sponsored/paid for by Guru Labs. Thanks a lot!



// Only street found? If it's in the US we can check TIGER data for nearest housenumber
if ($bIsInUnitedStates && $iPlaceID && $aPlace['rank_search'] == 26)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rank_search == 27 might be relevant, too (named service roads, tracks and footways)

@mtmail
Copy link
Collaborator Author

mtmail commented Apr 28, 2015

Thanks for reviewing.

  • added rank_search==27 for non-highways
  • on smaller zoom levels (<17) we now skip looking at Tiger data
  • improved test. You're right, it even passed against an unchanged Nominatim installation

Running the test case:
NOMINATIM_SERVER=http://46.101.149.108:9876/nominatim lettuce features/api/reverse.feature --tag=Tiger => pass
NOMINATIM_SERVER=http://nominatim.openstreetmap.org lettuce features/api/reverse.feature --tag=Tiger => fail (expected)

@lonvia lonvia merged commit 2e1590e into osm-search:master Apr 30, 2015
@lonvia
Copy link
Member

lonvia commented Apr 30, 2015

Merged, thanks a lot. The new feature will be deployed on nominatim.osm.org in the next couple of days.

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