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

Overpass ST_PointOnSurface

0

There are an Overpass option or workaround to obtain ST_PointOnSurface()-equivalent instead the usual centroid?

It is important to "area relations" (and welcome similar behaviour with ways). It returns the centroid or, when is not inside the surface, returns a point (a projection from centroid) that is guaranteed to lie on the surface.

asked 14 Aug '18, 15:13

ppKrauss's gravatar image

ppKrauss
95192225
accept rate: 0%

edited 14 Aug '18, 15:19

(14 Aug '18, 15:34) kocio

Thanks @kocio. As we see in the discussion ,there are a lack of formal specification... Perhaps I need only to check what the Overpass command center is doing: is the PostGIS ST_Centroid() or the ST_PointOnSurface()? ... When I check wiki/Overpass_API/Overpass_QL it says "center: ... The center point is not guaranteed to lie inside the polygon". If the Wiki is correct, my question ("there are a workaround?") make sense.

(14 Aug '18, 15:46) ppKrauss

Hi @kocio, I checked before about center, there are nothing. Only say that center is not the solution (and is not a centroid, is only a BBOX center). All links seems to say nothing about "center alternative".

(14 Aug '18, 16:04) ppKrauss

Source code available on GitHub .