2

I'm looking to host an autocomplete service. I have installed Nominatim and imported the planet file with Nominatim. It took about 3 days to dump data into database and an additional 7 days to run indexes on an Amazon EC2 extra large instance without any database tuning.

The problem with Nominatim, is that it is designed to parse a complete address and not isolated letters. I would like to modify the code to accept what we could call partial queries, i. e. if the map is showing France, and the user types the letter 'p', the first result is "Paris, France".

https://github.com/twain47/Nominatim/blob/master/lib/Geocode.php#L343

I'm looking for advice from someone who has attempted this before in order to avoid diving into 1500 lines of code and hitting a snag.

Geocoding on my installation is not performing well even without type ahead, and I don't know if it will be possible to host a decent service.

I found this library https://github.com/komoot/photon which seems to work fast enough, but it doesn't seem to include a bounding box as a parameter to the search. I would like this service to work as good as possible with existing Open Source tools and without a third party hosting service.

Is typeahead achievable using available libraries and data, with a small effort, let's say 80 hours of coding/investigation?

5
  • 1
    try github.com/klokan/nominatim-autocomplete
    – Mapperz
    Dec 17, 2013 at 21:21
  • If I'm not mistaken, it looks like it's a Javascript library only?
    – martincho
    Dec 17, 2013 at 21:40
  • what are your expectations?
    – Mapperz
    Dec 17, 2013 at 22:01
  • If you're browsing a map and the center is on France, and you press "P", get Paris as first or second result. I think Nominatim can do that, but the thing is it's designed to work with complete addresses instead of autocomplete. I wonder if it would be possible to modify the code to get autocomplete working. I'm going to try anyway, but I would like to hear opinions before jumping into 1500 lines of PHP code.
    – martincho
    Dec 18, 2013 at 11:55
  • Its possible to use typeahead & bloodhound with photon. This blog post might help(?).
    – doles
    Sep 22, 2014 at 19:05

2 Answers 2

4

Search-as-you-type is not possible in nominatim by design. It goes for exact matches of the search terms.

Photon is based on Apache Solr which provides a built-in spatial support. Little effort should be needed to enhance photon to provide a location bias. The basic idea is to rank the search results by distance to the bounding box.

I am the main contributor of photon and can assist you and guide you through the manuals, feel free to contact me: christoph[°]komoot.de

0

Gisgraphy can do search as you type for streets once you've choose a city : auto-complete with Gisgraphy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.