[Tile-serving] [openstreetmap/osm2pgsql] Add implementation of simplify function for multilinestrings (PR #1782)

Jochen Topf notifications at github.com
Fri Sep 30 08:34:15 UTC 2022


@joto commented on this pull request.



> @@ -117,6 +120,19 @@ class linestring_t : public point_list_t
         return 1;
     }
 
+    /**
+     * Check validity of linestring.
+     *
+     * By the OGC definition a linestring must have at least two distinct
+     * nodes to be valid. We are a bit more strict and require that the
+     * first two nodes are also distinct. When we create linestrings from
+     * OSM data this will always be the case.
+     */
+    bool is_valid() const noexcept
+    {
+        return size() > 1 && (*this)[0] != (*this)[1];

I have remove the is_valid() function now and do the check without it. This should be less confusing.

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

Message ID: <openstreetmap/osm2pgsql/pull/1782/review/1126466749 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220930/b027be23/attachment-0001.htm>


More information about the Tile-serving mailing list