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

I'm using overpy library to query overpass via python.

I'd like to have a list of entities with a certain tags and their coordinates. For nodes this is straightforward. For closed ways (polygons) I'd just need the centroid lat/lon.

Often those aren't stored in center_lat,center_lon, so I'm launching queries against the list of nodes associated to that ways entity.

This query, using get_nodes, leads to a lot of HTTP errors (apparently overpy requires to launch queries again to get this). So, I'm wondering if there's a more efficient route to get what I need (and in the mean time don't bother the servers so much).

asked 10 Oct '17, 16:53

WouterDX's gravatar image

WouterDX
26113
accept rate: 0%


use "out center" as e.g. in this query which gives the center nodes of buildings.

permanent link

answered 11 Oct '17, 04:07

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

Perfect, thanks.

(11 Oct '17, 09:03) WouterDX

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:

×483
×191
×167
×78

question asked: 10 Oct '17, 16:53

question was seen: 6,097 times

last updated: 11 Oct '17, 09:03

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