1
1

I'm building a mobile application. One of the features shows bus stops on a map. When the user zooms in far enough, bus stops should load for the area they are looking at.

I have found part of the API that should help me do this:

/api/0.6/map?bbox=left,bottom,right,top

This should be called every time the user pans around the map so that it loads a fresh set of bus stops for that area. My problem is, when I do this I'm receiving way too much data that is not related to the bus stops. I need to see nodes only by user: NaPTAN (104459). Is there a way I can filter down the results like this? Essentially I need to be loading the bus stops every time the user pans across the map, for this to be productive the bus stops need to have been loaded ideally > 500 milliseconds and < 1 second. It would also probably be better to receive the files in JSON format rather than XML as this will save a chunk of bytes increasing download speed.

If anyone can give me advice on the best way to do this I'd really appreciate it!

Thanks

asked 07 Sep '13, 13:26

jskidd3's gravatar image

jskidd3
46225
accept rate: 0%


3 Answers:
6

The Overpass API allows to specify complex filters. It is also faster and more suited than the main API which is actually for editing and not for running bulk queries. Another option is to download the data in advance to store it locally. This way you are completely independent from the API and don't have to comply with the usage policy.

permanent link

answered 07 Sep '13, 19:39

scai's gravatar image

scai ♦
31.9k20291442
accept rate: 23%

3

you should not use API 0.6 for that, see it's usage policy - it is intended for editing only, and for such queries. There are alternative ways mentioned on the page, from setting up your own server syncing data with master openstreetmap servers, to using third party services.

permanent link

answered 07 Sep '13, 17:22

Matija%20Nalis's gravatar image

Matija Nalis
7211714
accept rate: 13%

2

As already stated Overpass should help you. Have a look how overpass-turbo does it:

If you only need the coordinates: http://overpass-turbo.eu/s/10g

If you need more details: http://overpass-turbo.eu/s/10h

You will probably have to consider whether you really want to query for each single pan (or if it would be better to query a bigger bbox and only requery if the user leaves the bbox).

/al

permanent link

answered 09 Sep '13, 11:31

_al's gravatar image

_al
84521018
accept rate: 4%

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:

×248
×72
×33
×32
×24

question asked: 07 Sep '13, 13:26

question was seen: 10,348 times

last updated: 09 Sep '13, 11:31

powered by OSQA