Hi, Im very new to OSM. Is there a way to see if a lat/long point happens to lie on a railway? Also is it possible to get the train stations along that route? (if it has been found that is). What im trying to achieve is similar to a road/ building lookup request such as: Thanks in advance. asked 04 Mar '14, 15:44 gmeister4 aseerel4c26 ♦ |
Please have a look at http://overpass-turbo.eu/s/2GN This queries for all ways that are in a small bounding box around latitude 51.451, longitude 7.01. You can send these requests also directly to the API endpoint http://overpass-api.de/api/interpreter . The whole API is documented at http://wiki.osm.org/wiki/Overpass_API answered 05 Mar '14, 07:32 Roland Olbricht |
The alternative is importing OSM data into a PostGIS database with osm2pgsql, and then running the query like
This will check for any ways that have a railway tag and are within 10 projection units (approximately 10 metres) of the given point and list the OSM IDs of these ways. answered 05 Mar '14, 08:22 Frederik Ramm ♦ |
I'm so interested on it. Is it possible to reverse geocode the railways? For the moment I'm reading and trying to check the code in case that i need to change... So, in case that it's possibl eto reverse geocode reailways, do I have to import (again) the information to my own nominatim or the info is already there? Thanks in advance! answered 05 May '15, 09:54 soyeya 2
If you've got a different question, you're better off asking that in a new question (and refer back to this one if appropriate) rather than adding an answer to this question that is actually not an answer but a new question.
(05 May '15, 10:00)
SomeoneElse ♦
|
The answer is: "yes". ;-) To clarify the question: you are searching a feature of nominatim? Or any publically available webservice? Or would you set up a program yourself if needed?
meta: I guess your question part for the stations should rather be another question as it is not really related to the first one (in fact three parts are imaginable: 1. finding out if there is a railway in a sufficently near distance, 2. which routes are on this railway, 3. which stations are on this route). If others agree and if you cannot find an answer in the old questions here, please ask it as a separate question.
Hello aseerel :) Thanks for the reply. I have been experimenting with nominatim, and it returns any road/ building name (and train station!) but does not seem to reverse geocode a railway if I pass in coordinates that I know a rail line does lie upon.
A public web request service that provides this functionality (like nominatim) would be ideal for my purposes, but setting up a program to handle the data myself would also be a possibility