How can I do Reverse Geocoding on my own Server?
Asked Answered
V

3

7

We are getting a lot of data and are trying to build a system on our database which can convert latitude-longitude information to city and country. We don't want to use any of the google Api's. We want to set our own server to do this.

Veronikaveronike answered 29/1, 2014 at 11:54 Comment(0)
E
5

Take a look at Nominatim. It is a popular service for OpenStreetMap capable of answering geocoding and reverse-geocoding queries. It is also possible to set up your own Nominatim instance. If you want to use a public instance instead then make sure to comply with OSM's Nominatim usage policy because the server runs on donated ressources. Alternatively you can use another public instance, for example the Nominatim instance provided by MapQuest.

Edinburgh answered 29/1, 2014 at 12:47 Comment(0)
H
4

If you plan to do a do-it-yourself on a server, the simplest way I would recommend is to use a FREE database of cities that include a latitude/longitude of the city's area centroid. Import the dataset into your own database.

You can then do a distance check (query) between your point and the area centroid looking for the city centroid the point is closest to. Just remember for performance purposes:

  1. Store the cities latitude/longitude as a geospatial POINT() datatype (not as a decimal!)
  2. Create a geospatial index for the field that has the POINT() value for the city center.

If you use MySQL, there are a lot of answers in stackoverflow on how to do this (just search):

Here are some FREE datasets:

MaxMind: http://www.maxmind.com/en/worldcities

Geonames.Org: http://www.geonames.org/export/

OpenGeoCode.Org (I am a co-founder of this open data project): http://www.opengeocode.org/download.php#cities

Hamil answered 29/1, 2014 at 22:45 Comment(0)
P
0

You should setup your own Nominatim server, you can find step by step instruction here http://nominatim.org/release-docs/latest/admin/Installation/

or

https://gist.github.com/malkitsingh/737ea34abec5b079a84dd39e3b0dc2d2

but for this you will need strong server with lot of space.

Palestrina answered 6/8, 2019 at 13:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.