# [GRASS-dev] grass-dev <grass-dev@lists.osgeo.org>

Benjamin Ducke benjamin.ducke at oxfordarch.co.uk
Wed Sep 16 11:04:08 EDT 2009

```----- "Hamish" <hamish_b at yahoo.com> wrote:

> Ben:
> > Assigning centroids using a 2D placement algorithm works as long as
> > the 3D polygons have some area in the X-Y plane.
>
> So, make the placement algorithm 3D. If it is a simple plane it is
> just a little math to find the z value. "Just" rotate the plane, find
> your centroid point in 2D, then reverse the plane rotation back into
> x-y space.   (ok, lat/lon polar coords is a slightly curlier problem)

Yes. That's what I was thinking, too.

>
> Assuming that the centroid type can store a 3D point, it should be
> fine.
>
> On your 2D plan-view display monitor it would appear as a point on
> a line, but as soon as you put in a 3D renderer you'd see it as a
> point in the middle of the plane.

Exactly.

>
> > That is certainly true for the surfaces of water bodies.
>
> I'm not sure I understand that. You mean like perched lakes?
> ie horizontal area floating in 3D space with a constant elevation?
> (& water bodies are never truly flat, with wonderful consequences,
> but that's completely off-topic)

Well, if you fit an X-Y plane anywhere through your lake, at any
elevation, the lake's cutting plane should have an area > 0.

>
>
> > But there are some extreme cases ("catenas", vertical
> cross-sections)
> > where this will fail.
>
> As long as the centroid placement calc's the z value for the
> centroid,
> and we stick with plane geometry for faces, besides a little coding
> what's the problem?

None. If we have a 3D centroid placing algorithm.

>
>
> > Also, for automated labeling, the centroid position will not be
> > ideal.
>
> Centroids are not label positions and the should not be expected to
> be used as such. It should be up to the S.A. (or whatever) rendering
> code to decide how to place the label within the area wherever it
> looks the best.
>
>
> Hamish

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

```