-
The first aim of my work was to add the support of 3D geometries in PostGIS. We have 12 geometries already existing in it : Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, Curve, MultiCurve, PolygonCurve, MultiSurface, GeometryCollection. The two geometries I added are some specific MultiPolygon described in
OGC SFS1.2 norm. They are:
- TIN for Triangular Irregular Network
- POLYHEDRALSURFACE.
This last one is a collection of contiguous 3D Polygons which share some edges and describe a 3D volume. A TIN is a POLYHEDRALSURFACE where all Polygons are Triangles.
The SQL syntax is the same for these two new geometries and MultiPolygons:
- -MULTIPOLYGON(((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 0 1 0, 0 1 1, 0 0 1, 0 0 0)))
- -TIN(((0 0 0, 1 0 0, 0 1 0, 0 0 0)),((0 0 0, 1 0 0, 0 0 1, 0 0 0)),((0 0 0, 0 0 1, 0 1 0, 0 0 0)),((0 0 1, 1 0 0, 0 1 0, 0 0 1)))
This TIN describes a tetrahedron.
- POLYHEDRALSURFACE(((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)), ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1)),((1 0 0, 1 1 0, 1 1 1, 1 0 1, 1 0 0)),((1 1 0, 0 1 0, 0 0 1, 1 1 1, 1 1 0)))
This POLYHEDRALSURFACE describes a cube
It's possible to create some 2D TIN or POLYHEDRALSURFACE but their main aim is to describe 3D volumes.
It's not possible to create TIN & POLYHEDRALSURFACE with Multirings Polygons. It's in their mathematical definition, faces of PolyhedralSurfaces can't have holes.
Some PostGIS export functions are available for these geometries:
- asEWKB
- asEWKT
- asKML
- asSVG (only 2D output)
- asGML (only 2D output)
- Summary
Here are some examples of TIN and POLYHEDRALSURFACE manipulation:
______________________________________________________________________________________________________SELECT asewkt('TIN(((1 2 3, 3 4 5, 4 5 6, 1 2 3)))');SELECT asSVG('POLYHEDRALSURFACE(((0 0, 0 1, 1 1, 1 0, 0 0)),((1 0, 2 0, 2 1, 1 1, 1 0)))');SELECT asGML('POLYHEDRALSURFACE(((0 0, 0 1, 1 1, 1 0, 0 0)),((1 0, 2 0, 2 1, 1 1, 1 1, 1 0)))');______________________________________________________________________________________________________
-