1

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%


One Answer:
3

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
18.7k16159298
accept rate: 20%

Perfect, thanks.

(11 Oct '17, 09:03) WouterDX

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:

×377
×156
×144
×53

question asked: 10 Oct '17, 16:53

question was seen: 2,077 times

last updated: 11 Oct '17, 09:03

powered by OSQA