[Tile-serving] [openstreetmap/osm2pgsql] Add implementation of simplify function for multilinestrings (PR #1782)
Jochen Topf
notifications at github.com
Thu Sep 29 19:52:40 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];
Not in the case we have so far, but I would expect that this function will be useful for other cases where we didn't explicitly remove duplicates, so I'd rather keep that.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1782#discussion_r983963791
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/osm2pgsql/pull/1782/review/1125911241 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220929/da60d09d/attachment.htm>
More information about the Tile-serving
mailing list