Hi, I installed a local osm tile server follows "https://wiki.debian.org/OSM/tileserver/jessie" instructions. So, I have a mapserver on "http://localhost/osm_tiles/0/0/0.png" site. I visualized my map with LeafletJS, it's works fine. My question: if I positioning my map to a point (lat/long coordinates) how I get this point local info (city name, street name etc...) ? How do I reverse geocoding from my system? (I don't want to do it from outter source) Thanks for your answers. Ps.: sorry for my bad english... asked 24 Mar '16, 07:11 Leslie Gal |
You will have to set up a Nominatim server for address search and reverse geocoding. Check out http://wiki.openstreetmap.org/wiki/Nominatim/Installation for detailed instructions. answered 24 Mar '16, 08:13 jot Thank for your answers Frederik and jot. Both answers is perfect for me. One-one green pipeline to you! Thanks again.
(25 Mar '16, 07:15)
Leslie Gal
|
Installing your own Nominatim instance with a separate copy of the data is the best way to do it. However if you only use it occasionally and you don't mind a small performance penalty you can also hack together a few PostGIS queries that will give you the nearest street, city and so on from a normal rendering database, for example to find the nearest street to a point with the coordinates mylat,mylon you would do something like
or to find the city boundary that contains the point,
You might have to wrap the ST_MAKEPOINT in a ST_SETSRID(..., 3857) or ST_SETSRID(..., 900913) depending on your setup. answered 24 Mar '16, 08:40 Frederik Ramm ♦ |