Boost logo

Geometry :

Subject: Re: [geometry] bounding object calculation (was: how to find the furthest point pair (= diameter) of a polygon?)
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2013-08-15 17:18:26


Hi,

Barend Gehrels wrote:
>
>> bg::envelope() and bg::return_envelope() will probably handle other
>> bounding objects than Box. Am I right? Or some other name is choosen?
>
> As said earlier, envelope is an OGC algorithm with a specific meaning
> and the name is well-chosen. I guess more than 99% of the envelopes in
> your postbox is rectangular. The association is OK.
>
> So we might stick to PostGIS convention and call it
> minimum_bounding_circle, or replace the circle with a "ball" or
> "nsphere" suffix to denote dimensions higher than 2.
>

I propose to choose a general name and implement a function calculating
a bounding Geometry of arbitrary type. I'm using bounds() in the Index
to return spatial index's bounding object. For example:

typedef model::box<..> Box;
Box box = return_bounds<Box>(some_geometry);
bounds(other_geometry, box);

typedef model::nsphere<..> Sph;
Sph sph = return_bounds<Sph>(some_geometry);
bounds(other_geometry, sph);

This function could calculate bounding boxes, nspheres and convex
polygons/rings and in the future Geometries currently not available like
oriented boxes, ellipsoids, capsules, cylinders and other frequently
used in e.g. physics engines.

Regards,
Adam


Geometry list run by mateusz at loskot.net