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

Hi

I am trying to find a way to automatically export the (lat, long) of the nodes associated with the perimeter of a given building without using the UI, completely through API. The ideal solution would be given an address of a building (way with tag building in OSM terms) to fetch the (lat, long)s of the associated nodes in an XML or plain text file.

Any insights? Kris

asked 09 May '18, 14:11

hectorlavoe's gravatar image

hectorlavoe
21112
accept rate: 0%


The standard API call

http://api.openstreetmap.org/api/0.6/way/put_way_id_here/full

returns an XML containing the way and all its nodes, though the order of the nodes in the response might be different from the order in which they have to be traversed to form the line (i.e. you will have to traverse them in the right order as given in the way object).

permanent link

answered 09 May '18, 14:48

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thanks Frederik! That seems to be really helpful! However, the link gives me a 404 error. Could you please re-post?

Many thanks, Kris

(14 May '18, 15:03) hectorlavoe

You need to replace put_way_id_here with the way ID of your building.

(14 May '18, 15:05) scai ♦

Great, that's super neat! Thank you.

(30 May '18, 10:16) hectorlavoe

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:

×290
×252
×205
×3
×3

question asked: 09 May '18, 14:11

question was seen: 1,921 times

last updated: 30 May '18, 10:16

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