[postgis-devel] Caching definition of plane in geometry

Nicklas Avén nicklas.aven at jordogskog.no
Sat Dec 18 04:04:39 PST 2010


Hallo

I have a probably very naiv question/idea. I am looking (an hour now and an hour then) on the 3d distance functions against polygons (and polyhedrals). 

What is most difficult I think will be the same problem for most comming 3d funktionality. It is about defining the plane of a ed polygon. The difficulty is that all vertexes will never be on the same plane because of precision problems. The exception is the triangle since the three points defining the triangle is excactly the amount of informarion that is needed to define a plane. If there is more vertex points there will be more than one possible 3-point combinations and most likely more than one plane definition. Of course there is more exceptions where there will be no problem but the problem will often be there.

I have an idea hod to get some sort of average plane out of a bunch of vertex-points and there is probaby many algorithms out there. This calculations will take some calculations though. At least more than calculating the bbox.

My question is if it would be an idea to store the plane definition in the geometry. What is needed is two pointers to 3d points (or one pointer to a plane definition structure of two points). First point is on the plane and the secont is one unit away perpendicular to that plane from the first point. In that way we should handle that like the bbox and recalculate it at the same occations as we recalculate the bbox. One difference is that this plane has to be stored for each part of the geometry that can use another plane. So holes in a polygon won't need it but all multiparts in a multipolygon. 

I don't know how much we will try do make PostGIS 3d in the future but I think something like this will be nessecary in the long run if we want to implement more functionality.

I understand it might be to late for 2.0 but I guess next chance is 3.0

Regards
Nicklas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20101218/2e9ae4f5/attachment.html>


More information about the postgis-devel mailing list