[OSM-dev] Is there any API to get data from OSM as geoJson?
Stefan Keller
sfkeller at gmail.com
Sun Feb 10 01:06:41 GMT 2013
Hi Pawel
2013/2/8 Paweł Paprota <ppawel at fastmail.fm>:
> In the future (whether near or far, hard to say) there should be additional
> API for serving "vector tiles" worldwide - that would possibly power
> browser-side map rendering (KothicJS and such).
So you mean given a tile location like this
http://c.tile.openstreetmap.org/16/34372/22990.png
return a vector tile set of GeoJSON features?
What makes me wondering is this: When entering
http://owl.osm.org/api/0.1/changesets/16/34372/22990.geojson
... do I already get a "changeset" from this tile including all geometries?
To Martin and Ander:
Martin suggested to use Overpass output. He also pointed to
OSM4Leaflet.js which does resolve node id's in ways to linestrings.
I would avoid such client-side calculations (except perhaps it's about
an editor or admin too) since this can be done on server-side.
But I think Overpass can already do that:
<osm-script>
<union>
<query type="node">
<has-kv k="cuisine" v="pizza"/>
<bbox-query e="10.5194091796875" n="47.92738566360356"
s="45.45627757127799" w="5.69091796875"/>
</query>
<query type="way">
<has-kv k="cuisine" v="pizza"/>
<bbox-query e="10.5194091796875" n="47.92738566360356"
s="45.45627757127799" w="5.69091796875"/>
</query>
<recurse type="way-node"/>
</union>
<print/>
</osm-script>
The response includes nodes and ways (which are eal GeoJSON
linestrings) because of the "magic" recurse syntax.
Yours, Stefan
2013/2/8 Paweł Paprota <ppawel at fastmail.fm>:
> Hi Ander,
>
> Probably not exactly what you are looking for but at least it's OSM data in
> GeoJSON format :-) - OwL API serves GeoJSON for changeset data:
>
> http://owl.osm.org/api/0.1/changesets/15/18076/11129/18080/11131.geojson
>
> In the future (whether near or far, hard to say) there should be additional
> API for serving "vector tiles" worldwide - that would possibly power
> browser-side map rendering (KothicJS and such).
>
> Paweł
>
>
> On 02/07/2013 05:58 PM, Ander Pijoan wrote:
>>
>> Hi everyone
>>
>> I am currently working with different technologies for showing OSM data
>> in slippy maps and I noticed that some of those maps would work better
>> with GeoJSON data format.
>>
>> I use Overpass API for downloading data but it doesn't export in GeoJSON
>> format. The nearest approach would be to ask for it as OSM-JSON, store
>> all the nodes ids and locations, store all the ways ids and node refs
>> and then build the relations geometries but it's quite a big pain for
>> browsers.
>>
>> I've been looking for some info in OSM wiki but I haven't been able to
>> find nothing. Does anyone know if there exists something?
>>
>> Thank you very much.
>>
>> --
>> Ander Pijoan Lamas
>> Research Assistant, Deustotech
>> Computer Science Engineer
>> University of Deusto
>>
>> E-mail: ander.pijoan at deusto.es <mailto:ander.pijoan at deusto.es>
>>
>> Phone: +34 664471228
>> in: http://www.linkedin.com/profile/view?id=162888312
>>
>>
>> _______________________________________________
>> dev mailing list
>> dev at openstreetmap.org
>> http://lists.openstreetmap.org/listinfo/dev
>>
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
More information about the dev
mailing list