[Tile-serving] [osm2pgsql-dev/osm2pgsql] Add callbacks for delete actions (PR #2344)

Sarah Hoffmann notifications at github.com
Wed Jun 25 19:23:17 UTC 2025


@lonvia commented on this pull request.



> +                    std::array<char, 2> tmp{"x"};
+                    tmp[0] = osmium::item_type_to_char(member.type());
+                    luaX_add_table_str(lua_state, "type", tmp.data());
+                    luaX_add_table_int(lua_state, "ref", member.ref());
+                    luaX_add_table_str(lua_state, "role", member.role());
+                });
+        }
+
+        lua_pushliteral(lua_state, "tags");
+        lua_createtable(lua_state, 0, (int)object.tags().size());
+        for (auto const &tag : object.tags()) {
+            luaX_add_table_str(lua_state, tag.key(), tag.value());
+        }
+        lua_rawset(lua_state, -3);
+
+        // Set the metatable of this object

This is just an implementation detail. If we need functions later, we can change it back to being a real Lua object (possibly of its own type). The user shouldn't rely on the type and assume duck typing is in place.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2344#discussion_r2167452828
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/pull/2344/review/2959384317 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20250625/571d1e82/attachment-0001.htm>


More information about the Tile-serving mailing list