[Tile-serving] [openstreetmap/osm2pgsql] Optionally wrap polygon geometries in multipolygons (#1327)

Sarah Hoffmann notifications at github.com
Thu Nov 19 10:21:29 UTC 2020


@lonvia commented on this pull request.

Looks good to me. Can we have nice error messages now instead of COPY failing on bad geometry types?

>                             osmium::Relation const &relation,
                            osmium::memory::Buffer const &buffer) const
 {
     assert(builder);
 
-    return builder->get_wkb_multipolygon(relation, buffer, m_multi);
+    auto create_multigeoms = geom::create_multi_t::never;
+    if (target_geom_type == table_column_type::multipolygon) {
+        create_multigeoms = geom::create_multi_t::always;
+    } else if (m_multi) {
+        create_multigeoms = geom::create_multi_t::optional;
+    }

If I read this right, then the `multi` flag is ignored, when the type is MULTIPOLYGON. Makes perfect sense but it might be worth documenting (and possibly testing, to document that this was the intended behaviour ;).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1327#pullrequestreview-534270188
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20201119/4d49d5b1/attachment-0001.htm>


More information about the Tile-serving mailing list