NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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:

http://nominatim.openstreetmap.org/reverse?format=xml&lat=50.120578&lon=8.741684&zoom=17&addressdetails=1

Thanks in advance.

asked 04 Mar '14, 15:44

gmeister4's gravatar image

gmeister4
608812
accept rate: 0%

edited 05 Mar '14, 00:21

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

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?

(04 Mar '14, 23:32) aseerel4c26 ♦

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.

(04 Mar '14, 23:35) aseerel4c26 ♦

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

(04 Mar '14, 23:53) gmeister4

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

permanent link

answered 05 Mar '14, 07:32

Roland%20Olbricht's gravatar image

Roland Olbricht
6.7k36489
accept rate: 36%

The alternative is importing OSM data into a PostGIS database with osm2pgsql, and then running the query like

SELECT 
    osm_id 
FROM 
    planet_osm_line 
WHERE
    railway IS NOT NULL
    AND st_dwithin(way, st_transform(st_setsrid(st_makepoint(7.01,51.451), 4326), 3857), 10);

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.

permanent link

answered 05 Mar '14, 08:22

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

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!

permanent link

answered 05 May '15, 09:54

soyeya's gravatar image

soyeya
111
accept rate: 0%

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 ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×689
×85
×68

question asked: 04 Mar '14, 15:44

question was seen: 9,519 times

last updated: 05 May '15, 10:00

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum