[Tile-serving] [openstreetmap/osm2pgsql] Centroid of linestrings (Issue #1771)
Fabian Freund
notifications at github.com
Wed Sep 21 14:13:55 UTC 2022
In some scenarios it is not possible to create a polygon (when e.g. the way has less than 4 points). But I still want to obtain the centroid.
In the documentation it is stated, that this only works with polygons/multipolygons. I gave it a shot and anyways, it is possible to obtain a centroid from linestrings like `object:as_linestring():centroid()`. This works in all cases, when it is not possible to create a polygon (when `polygon:is_null()`), with the single exception when a relation has only one node (like https://www.openstreetmap.org/relation/7360610). PostGis is working in this scenario `select ST_Centroid(ST_MakePoint(1, 1))`.
I tried to convert the geometry into a single point via `object:as_point()` but the call is not possible outside node processing.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/1771
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/osm2pgsql/issues/1771 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220921/5f28a110/attachment.htm>
More information about the Tile-serving
mailing list