[Tile-serving] [osm2pgsql-dev/osm2pgsql] `object:as_multipolygon()` does not take `object.members` into account. (Issue #2098)
Christopher Kwiatkowski
notifications at github.com
Thu Oct 19 12:41:42 UTC 2023
The following code removes members from object.members that have a role other than 'inner' or 'outer'.
```lua
function osm2pgsql.process_relation(object)
if object.tags.type == 'boundary' and object.tags.boundary == 'religious_administration' and object.tags.admin_level == '10' then
for i = #object.members, 1, -1 do
if object.members[i].role ~= "inner" and object.members[i].role ~= "outer" then
table.remove(object.members, i)
end
end
local mp = object:as_multipolygon()
parishes:insert{
name = object.tags.name,
geom = mp
}
end
end
```
However, although `object.members` only contains objects from which a boundary should be created `object:as_multipolygon()` takes into account all members, even removed ones.
--
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/issues/2098
You are receiving this because you are subscribed to this thread.
Message ID: <osm2pgsql-dev/osm2pgsql/issues/2098 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20231019/48b96e05/attachment.htm>
More information about the Tile-serving
mailing list