[Tile-serving] [openstreetmap/osm2pgsql] Add implementation of simplify function for multilinestrings (PR #1782)
Sarah Hoffmann
notifications at github.com
Thu Sep 29 19:19:54 UTC 2022
@lonvia 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];
Is the second check still needed now that you are explicitly removing duplicates?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1782#pullrequestreview-1125868729
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/osm2pgsql/pull/1782/review/1125868729 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220929/d8c22edb/attachment.htm>
More information about the Tile-serving
mailing list