GEOS : isvalid operator



DEFINITION :

Now
, PostGIS is able to store 3D geometries as TIN and POLYHEDRALSURFACE and to import 3D data with the collada2pgsql command.
Functionalities are added in order to manipulate these new geometries. First, it had to implement the isvalid operator in GEOS for TIN and POLYHEDRALSURFACE. GEOS (Geometry Engine Open Source) is a geometric library for PostGIS and the isvalid operator is based on the mathematical definition of geometries.

So isvalid operator check if :

  • all faces are connected :













  • there are no self-intersections :














  • neighbour faces have the same orientation :













It's important to notice that a TIN or a POLYHEDRALSURFACE stored in PostGIS can represent a 3D volume but not be a valid geometry if we refer to its mathematical definition.



EXAMPLES :

Three examples of isvalid operator use :











____________________________________________________________________________________________________

SELECT isvalid('TIN(((0 0 0, 1 0 0, 0 1 0, 0 0 0)), ((1 0 0, 0 0 1, 0 1 0, 1 0 0)))') ;
____________________________________________________________________________________________________










____________________________________________________________________________________________________

SELECT isvalid('TIN(((0 0 0, 1 0 0, 0 1 0, 0 0 0)), ((1 0 0, 0 1 0, 0 0 1, 1 0 0)))') ;
____________________________________________________________________________________________________










____________________________________________________________________________________________________

SELECT isvalid('TIN(((0 0 0, 1 0 0, 0 1 0, 0 0 0)), ((0 0 0, 1 0 0, 1 1 0, 0 0 0)))') ;
____________________________________________________________________________________________________