Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Filter on place and amenity places to find default location #6

Closed
wants to merge 3 commits into from
Closed

Filter on place and amenity places to find default location #6

wants to merge 3 commits into from

Conversation

raphink
Copy link

@raphink raphink commented Jun 4, 2012

This PR aims to fix bug 277: Project-OSRM/osrm-backend#277

It filters the JSON returned by Nominatim in order to avoid setting places on boundaries (which happens for most places), e.g. when searching for a town.

For now, the implementation is a bit rough, but it allows to find cities, towns, villages, amenities, etc. pretty well.

Ideally, I'm thinking of an implementation that would give a weight to classes, types, and distances from the other point (either start, end, or current view). For example, a place would get 100 points while an amenity would get 90. If the place is a country, then it would get 10 more, so 110, while a city would get 9, so 109, etc. In addition to that, distance would play a role, so that you could find a village if it's close to your start point, even if a bigger city far way bears the same name.

@DennisSchiefer
Copy link
Contributor

Sorry for the late reply - you just caught me during a week in which I was abroad. I'll be looking into your pull requests tomorrow.

@raphink
Copy link
Author

raphink commented Jun 11, 2012

Actually, I talked to @twain47 about it, and these features are coming in Nominatim (see other issues).

@DennisSchiefer
Copy link
Contributor

I read your comments to Issue #277. This means, we should close this pull request and wait until Nominatim offers these features directly?

@raphink
Copy link
Author

raphink commented Jun 11, 2012

Yes, most likely. The viewbox parameter PR (PR #10) is still useful for this, though.

@DennisSchiefer
Copy link
Contributor

Okay, then I am closing this pull request for now. When Nominatim adds these features and they are still not to our liking, we can reopen the request.

@DennisSchiefer
Copy link
Contributor

I have started a new branch trial/geocoder, you might want to look into. It uses the icons provided by Nominatim, outputs the type/class information and has built-in options for filtering / sorting.

While trying to find good priorities for sorting/filtering, I saw that there is no one good solution for everything. For example to British town of York only appears as an osm_type: relation, class: boundary, type: administrative, while other towns only appear as osrm_type: node, class: place, type: town. So, if you (or anybody else) can come up with a good sorting/filtering of the Nominatim results, I am happy to give it a try.

As a side note: Is there a comprehensive list of which types / classes Nominatim uses?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants