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

I am trying to create a mobile app for train delays, need to identify if the user is in a train station how can i do this? any ideas?

Using POSTCODE, GPS, Open data or anything else, POSTCODE just identifies a exact gps location but the person can be in any of the point around the station

Any way to identify this plz?

asked 07 Oct '16, 23:06

brightnlight's gravatar image

brightnlight
10224
accept rate: 0%

I am still waiting for any simple reply for my query, Couple of people have suggested me to go through the API and I have done my work and i need help, but here there is no one to say a simple request, I have posted my effort and asked for some kind help,

Would appreciate if someone comes up with a simple answer on how to question of how to find out if the person is in station or not as I am stuck and not able to find the answer myself!

Please

(12 Oct '16, 22:44) brightnlight
3

It isn't a simple question so there won't be a simple reply, I'm afraid. If you're having difficulty with the information provided then I suggest you employ a developer to help. People do try to help on this site but they can only point you in the right direction, not build the entire solution for you.

(13 Oct '16, 12:21) Richard ♦

The railway=station or public_transport=station tags define the area of a station, so you could check to see if the user's position is within one of those areas.

permanent link

answered 07 Oct '16, 23:36

alester's gravatar image

alester
6.6k266100
accept rate: 28%

Hello Alester

Thanks for your answer very much appreciated,

What I have is the users GPS coordinates of the user on a particular location (x,y) -from location finder of the mobile app

What i need is Inside which station is this person in currently?

Now from what I infer from you kind reply is that there is a API call I can make to openstreetmap to find out if the person is within the area of the station?

Can you provide me an example for this call please using my gps location of the user?

(08 Oct '16, 08:22) brightnlight
2

OSM does not provide an API for this type of query. You should look at something like Overpass instead (see multiple queries on this site).

(08 Oct '16, 09:53) SK53 ♦
-3

Hello Friend

I went with your help trying to find out examples of overpass, unable to get anything much

Please can you give me an example of the query view OSM or OPEN PASS to find given a input as x,y coordinates, if this coordinate is within the area of east croydon railway station

East croydon reference: http://geobrit.uk/302042289-east-croydon-station-railway-station-croydon-tq328658#data

(09 Oct '16, 21:58) brightnlight
2

You didn't look very far: try typing overpass into the search on this site or on the OSM Wiki. There are pages of documentation and nearly 500 questions with answers on this site alone. You will also find many answers about overpass on GIS StackInfo.

(10 Oct '16, 09:34) SK53 ♦

Thanks, had a good look and found the following query helped me to get the result for the train station EAST CROYDON. node["name"="East Croydon"]"train"="yes"; "type": "node", "id": 302042289, "lat": 51.3758448, "lon": -0.0927317, "tags": { "name": "East Croydon", "naptan:AtcoCode": "9100ECROYDN", "network": "National Rail", "platforms": "6", "postal_code": "CR0 1LF", "public_transport": "station", "railway": "station", "ref": "ECR", "source_ref": "train": "yes", "wheelchair": "yes", } }, { "type": "node", "id": 676877753, "lat": 51.3760143, "lon": -0.0923223, "tags": { "name": "East Croydon", "public_transport": "stop_position", "train": "yes" } }, + 4 more stop_position sections this had 6 records which includes different platform points (log and lat) with in the station But for me to identify the user within the railway station I need to cover the area of the whole east croydon station (land and building) the person can be anywhere here, how can i find the bounding box of the whole station so that i can then check if the person with X and Y is within the station?

Please help

(10 Oct '16, 12:07) brightnlight

Please can you help?

(11 Oct '16, 04:04) brightnlight
1

There is no "area of the whole east croydon station (land and building)" in OSM. So you have to perform some estimations based on the buildings, stops, platforms and similar elements. Read about railway stations in OSM.

(13 Oct '16, 07:57) scai ♦
showing 5 of 7 show 2 more comments

Before even thinking about stations, I'd take a step back and find out a bit about OpenStreetMap. The wiki has a link from the main page that talks about software development. In particular I'd read this page that shows what elements OpenStreetMap data is composed of, and I'd use taginfo to search for railway stations and explore the various elements.

permanent link

answered 10 Oct '16, 12:53

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Hello Friend Thanks, I did learn node, way and relation but the thing is In the api for railway it says http://wiki.openstreetmap.org/wiki/Key:railway#Other_railways railway station Node Area Railway station. whole area But then when i run this query in the turbo node["name"="East Croydon"]"railway"="station"; it returns one point, Please can you help? I am unable to proceed, Any clues otherwise plz

(10 Oct '16, 17:17) brightnlight
3

The reason that no-one's given you a simple answer is because there isn't one. Stop thinking about JSON for a second and think about geography. Your "one point" is this node:

https://www.openstreetmap.org/node/302042289

but near it are other places that you might think are "in the station". There are 3 platforms, such as this one:

https://www.openstreetmap.org/way/200673484

There's a railway station building:

https://www.openstreetmap.org/way/27297689

There's a tram stop:

https://www.openstreetmap.org/node/83701432

(and there are tram platforms too). There is an adjacent bus station:

https://www.openstreetmap.org/way/215645188

with bus stops, and there are some stops just outside the rail station such as:

https://www.openstreetmap.org/node/469761252

So take a step back and define yourself by what you mean by "within the station". Does it mean "within an area defined by any object that might reasonably be considered part of East Croyden Station"? If so, that's what you'll need to define and use.

(12 Oct '16, 23:39) SomeoneElse ♦

Well worded SomeoneElse. I was trying to say the same thing but wasn't sure how to phrase it. Basically, East Croydon Station isn't defined as a specific area which someone could 'be in'.

(13 Oct '16, 00:04) NZGraham

Thanks so much for your detailed explanation very much appreciated 1. Yes I realized that node is a point in space, so I need to define a area of a station to find out if the user has entered in to this space of area. 2. All the queries you provided is very interesting and again thats what I need (turbo queries to find out the best way to define what is the right way to define an area) 3. Please if you can provide me the turbo queries for the above then I would be able to find out and investigate more on defining the area of a station and then carry on more with my project work.

Much much appreciated for your help

(13 Oct '16, 10:01) brightnlight

Unfortunately I really can't help you define your own problem, much less provide a solution to it. There will be no one simple API/Overpass query that returns exactly the results that you need; you'll need to write some code to do that. Perhaps you need to engage with someone commercially and let them do it for you? There's one list at https://switch2osm.org/providers/ ; there are others in the OSM wiki.

(13 Oct '16, 12:02) SomeoneElse ♦

Thz but all i asked is the overpass equivalent for this url u posted for railway station building plz https://www.openstreetmap.org/way/27297689

(13 Oct '16, 12:51) brightnlight

As SK53 said above, overpass is pretty well documented in the wiki (and has been discussed at length in other questions). Are you allergic to reading documentation? :)

(13 Oct '16, 13:00) SomeoneElse ♦

Friend i understand i went through the documentation and tried many different way to get the overpass query https://www.openstreetmap.org/way/27297689 but unable to do so, wish you spend plz 2 mins to post the over pass query so i can carry on twiking it to get my area, plz help sorry to toruble

(13 Oct '16, 18:22) brightnlight

Someone else

Please can you tell me how to get the overpass query for the following map query https://www.openstreetmap.org/way/27297689

(15 Oct '16, 07:10) brightnlight
2

Go to https://overpass-turbo.eu/, open the wizard and run a query for building=train_station around "Croydon, London" -> http://overpass-turbo.eu/s/jmw

(15 Oct '16, 08:23) scai ♦

Thanks Scai , looks like i can now work from here much appreciated

(17 Oct '16, 08:54) brightnlight
showing 5 of 11 show 6 more comments

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:

×24
×19
×9

question asked: 07 Oct '16, 23:06

question was seen: 5,099 times

last updated: 17 Oct '16, 09:13

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