[Tile-serving] [openstreetmap/osm2pgsql] Fix: Create point geometry from collection with single-node way (PR #1767)

mboeringa notifications at github.com
Mon Sep 19 20:27:39 UTC 2022


> The problem is that if you drop that geometry, the geometry collection will contain one fewer geometry than you expected and you can't detect that. If you want to use a specific geometry of one of the members you might get the wrong one! So this is a fix for exactly that problem.

Thanks @joto for the response, but I am still slightly struggle to wrap my head around this.

OK, so this fixes the issue of the discrepancy that in the number of geometries in the geometry collection, and the number of members in the object.members array.

But does this fix then also ensure the 'type' returned by:
```
local geom = object:as_geometrycollection()
        local object_members = object.members

        for i = 1,geom:num_geometries(),1 do

            n_geom = geom:geometry_n(i)
            n_member_table = object_members[i]
            n_member_type = n_member_table.type
```

is auto-magically changed from 'w' to 'n' signify what happened in the **object:as_geometrycollection()** call?

Or am I simply completely misunderstanding this?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1767#issuecomment-1251514531
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/pull/1767/c1251514531 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220919/07b66f83/attachment.htm>


More information about the Tile-serving mailing list