[Tile-serving] [openstreetmap/osm2pgsql] Add geometry functions in Lua / new insert syntax (PR #1736)
Sarah Hoffmann
notifications at github.com
Wed Aug 10 10:04:50 UTC 2022
@lonvia commented on this pull request.
Should you update the PR maybe remove the 'work in progress' from the commit message.
> + */
+int geom_gc() noexcept;
+
+// The following functions are called when their counterparts in Lua are
+// called on geometry objects.
+int geom_area();
+int geom_centroid();
+int geom_geometry_n();
+int geom_geometry_type();
+int geom_is_null();
+int geom_num_geometries();
+int geom_segmentize();
+int geom_simplify();
+int geom_srid();
+int geom_tostring();
+int geom_transform();
Do these need to be public?
> +
+ local g = object:as_polygon()
+ tables.polygons:insert({
+ name = object.tags.name,
+ geom = g,
+ center = g:centroid(),
+ type = g:geometry_type()
+ })
+ end
+
+ function osm2pgsql.process_relation(object)
+ local g = object:as_multipolygon()
+ tables.polygons:insert({
+ name = object.tags.name,
+ geom = g,
+ type = g:geometry_type()
type is unused. Intentional?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1736#pullrequestreview-1067969598
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/osm2pgsql/pull/1736/review/1067969598 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220810/c300631a/attachment.htm>
More information about the Tile-serving
mailing list