2

I want to get a geocoding system based on OSM data and Elasticsearch engine. I've tried some projects like komoot\photon, but, as I'm a really newbie in this, I stuck on preparing of the data for my area and many troubles with a Nominatim server.

I could be using the whole world dump of indices but it is too big data for me(about 56Gb space). However, I found out I can use just Elasticsearch from scratch and some tool such as ogr2ogr which provide a support of a files converting from shape to elasticsearch. So, I downloaded shapefiles from geofabrik and converted some of them to Elasticsearch.

What kind of shapefiles (points, roads, places...) should I import to Elasticsearch for organize simple geocoding?

I'm thinking of using it on my Leaflet HTML page.

And what kind of requests should be to work with Elasticsearch engine then?

2

The Pelias Geocoder from mapzen runs on elasticsearch, and uses OSM data by default, though it can use any data source. The importers are split into separate modules, so even if your not interested in using the pelias geocoder, you may still find the OSM importer useful.

On another note: Shapefiles of OSM data are probably not what you want for source data, there are several sites that produce extracts as shapefiles, but the data is far more readily available in PBF format, and the PBF files are faster to process.

  • 1
    Thank you, Jesse! I'll certainly tale a look on that. I've just noticed it work on Node.js and I've never used it before. Can I use it on Windows 7? – Andrey Maraev Aug 11 '15 at 14:07
  • Yes, node works on windows 7. – Jesse Crocker Aug 11 '15 at 14:57
1

Take a look at https://github.com/kiselev-dv/gazetteer/tree/develop/Gazetteer It will create you a json index for osm file.

And you could use https://github.com/kiselev-dv/gazetteer/tree/develop/GazetteerWeb as an example of geocoder based on ElasticSearch

  • Hi, Dmitry! Thanks for your solution. I just want to clarify. I've download json dump from tr1.nowtaxi.ru/dumps and what I should do in next step? – Andrey Maraev Aug 11 '15 at 11:25
  • There are bunch of objects in file. Each line contains one object encoded as JSON object. Objects are adrpnt - addresses, poipnt - POIs, hghway - streets and so on. Every object contains information about object itself, and about higher address levels. You could upload them directly to ES or take a look at GazetteerWeb. – dmitry.v.kiselev Aug 11 '15 at 11:54
  • OK! If I want to take a look on GazetteerWeb how can I import json data there? – Andrey Maraev Aug 11 '15 at 13:03
  • 1
    Start it, and get localhost:8080/api/info.json it will return metadata about available api and parameters. To import data, you need localhost:8080/api/location/_import?source=/path/to/dump.osm.gz&drop=true&osmdoc=true It will asks you for a password. Password sha1 is in conf/dev/environment.properties – dmitry.v.kiselev Aug 11 '15 at 13:53
  • Great! Thanx, Dima! I'll try it – Andrey Maraev Aug 11 '15 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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