[Tile-serving] [openstreetmap/osm2pgsql] Some more work in the geometries (PR #1743)

Sarah Hoffmann notifications at github.com
Thu Aug 11 08:42:08 UTC 2022


@lonvia commented on this pull request.



>          fill_point_list(&line, way.nodes());
-        if (line.size() >= 2U) {
-            mls.add_geometry(std::move(line));
+        if (line.size() < 2U) {
+            geom->reset();
+        }
+    } else {
+        auto &multiline = geom->set<multilinestring_t>();
+        for (auto const &way : ways) {
+            linestring_t line;
+            fill_point_list(&line, way.nodes());
+            if (line.size() >= 2U) {
+                multiline.add_geometry(std::move(line));
+            }
+        }

There is a corner case here when there are multiple ways in the buffer but only one of them is valid. Then still a multilinestring with a single member is created. It's probably okay, just something we should keep in mind and potentially document.

> @@ -36,6 +36,25 @@ TEST_CASE("create_multilinestring with single line", "[NoDB]")
     REQUIRE(ml[0] == expected);
 }
 
+TEST_CASE("create_multilinestring with single line an no force_multi", "[NoDB]")

an -> and

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

Message ID: <openstreetmap/osm2pgsql/pull/1743/review/1069362195 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220811/ba7090f3/attachment.htm>


More information about the Tile-serving mailing list