This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Return lat and lon in API for ways

0
1

I would love to see the API-call

https://www.openstreetmap.org/api/0.6/way/214501181

to return

<osm version="0.6" generator="CGImap 0.6.1 (2060 thorn-02.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="https://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">

<way id="214501181" visible="true" version="4" changeset="49679796" timestamp="2017-06-19T23:15:34Z" user="WayneSchlegel" uid="548288">

<nd ref="2240372834" lat="48.5235762" lon="9.0594567"/>

<nd ref="2240372819" lat="48.5235762" lon="9.0594567"/>

<nd ref="2240372884" lat="48.5235762" lon="9.0594567"/>

<nd ref="2462021289" lat="48.5235762" lon="9.0594567"/>

<nd ref="2462021293" lat="48.5235762" lon="9.0594567"/>

<nd ref="2240372847" lat="48.5235762" lon="9.0594567"/>

<nd ref="2240372834" lat="48.5235762" lon="9.0594567"/>

<tag k="addr:city" v="Tübingen"/>

<tag k="addr:country" v="DE"/>

<tag k="addr:housenumber" v="1"/>

<tag k="addr:postcode" v="72074"/>

<tag k="addr:street" v="Brunnenstraße"/>

<tag k="building" v="house"/>

</way>

</osm>

This would be completely backwards compatible but would greatly simplify the fetching of geometries.

Is this the right place to discuss this matter?

asked 16 Oct '18, 08:56

dktue's gravatar image

dktue
11224
accept rate: 0%

edited 16 Oct '18, 10:46

Is this the right place to discuss this matter?

Not really - this is a site for getting help, not for discussing ideas. You probably want to try the dev@ mailing list (or the openstreetmap-website issue tracker, but the latter is really for concrete enhancement requests rather than discussion points).

(16 Oct '18, 12:09) Richard ♦

One Answer:

3

You are aware of the /full API call that gives you all the nodes together with the way? It is not as easy as your sketch above but goes some way to do it.

answered 16 Oct '18, 11:21

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

The corresponding URL for the way from your question would be simply https://www.openstreetmap.org/api/0.6/way/214501181/full.

(16 Oct '18, 13:22) scai ♦

Source code available on GitHub .