|
Geometry : |
Subject: [ggl] WKT empty
From: Bruno Lalande (bruno.lalande)
Date: 2009-06-13 13:36:42
Hi,
> OGC SFS defines "is empty" operation on geometry.
> For container geometries, it is easy to implement, though for point
> geometry...it's not.
> Possible options:
> - point class stores boolean indicator set during construction and
> modification
> - if for coordinate_type numeric_limits::has_quiet_NaN() is true,
> we could set coordinates of empty point to NaN and "is empty" check
> could rely on that.
Given the many different kinds of points the library must handle
(unmodifiable legacy points don't have place for an extra boolean, C
arrays don't either, etc...), the first option seems difficult to
implement. And given that has_quiet_Nan() might return false, the
second one doesn't do the trick in all cases.
Wouldn't it be better to let the user define how an empty coordinate
should be represented? After all, GGL is already very traits-driven.
So maybe having set_empty() / is_empty() functions in the point traits
could do the trick? The user can then define it as a NaN, or have a
dedicated boolean in his point, or anything else...
Regards
Bruno
Geometry list run by mateusz at loskot.net