Subject: Re: [geometry] nsphere and views names
From: Barend Gehrels (barend_at_[hidden])
Date: 2013-06-20 17:59:26
On 20-6-2013 19:36, Adam Wulkiewicz wrote:
> Adam Wulkiewicz wrote:
>> I've called it center_view because it may be used to 'see' some Geometry
>> as it's center. It might be used also for ellipses, boxes, etc.
>> E.g. in OpenStreetMap there are WAYs which are vectors of points and
>> describe LineStrings or Rings (it the first point is repeated at the
>> end). We could e.g. have linestring_view which allows to see a vector as
>> a Linestring and ring_view which allows to see vector as a Ring. And
>> those names could also be used for other points-containers/Geometries
>> (those classes could be Derived from some specialized implementations)
>> What do you think about those 'new' views? If you like it, should they
>> reside in some new namespace?
> Maybe something like this:
> geometry::view::as_centroid / as_center_point / as_center_point
Yes, this has been brought up earlier. It is certalinly useful to view a
geometry as another geometry type, and view::as_ring seems intuitive to me.
view::as_centroid is maybe too specific, maybe just view::as_point ?
Bruno did also have ideas about this.
We already have the "view_as" structure and make_view_as function, which
basically can do things like this. This is designed as:
boost::geometry::make_view_as<point>(sphere), which obviously returns a
point. This is not really worked out yet. See views/view_as
The box_view is indeed the other way round, it sees a box as something
So good this topic has been brought up again, thanks.
See also my other mail about closeable_view, and reversible_view, but
that is more viewing a Boost.Range like thing as another Boost.Range
like thing, so not exactly the same.
Geometry list run by mateusz at loskot.net