]> granicus.if.org Git - postgis/commitdiff
Simple TIN support to allow viz in QGIS
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 14 May 2019 21:33:40 +0000 (21:33 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 14 May 2019 21:33:40 +0000 (21:33 +0000)
References #4380

git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@17437 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
liblwgeom/lwgeom.c
postgis/lwgeom_geos.c

diff --git a/NEWS b/NEWS
index 031bbd196d03fabc71c5fca710a22bf0a2aaad58..4e2d351eb97039b70edb6d11063d6b088a35792b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PostGIS 2.5.3
   - #4348, ST_AsMVTGeom (GEOS): Enforce validation at all times (Raúl Marín)
   - #4361, Fix postgis_type_name with (GEOMETRYM,3) (Matt Bretl)
   - #4326, Fix circular arc distance calculation (Paul Ramsey)
+  - #4380, Simple TIN support to allow viz in QGIS (Paul Ramsey)
 
 
 PostGIS 2.5.2
index 52aa09675939743ace73c33997aa38a858dcf371..fac662d7efccefe14f0b7e530842ad6fbbcf4593 100644 (file)
@@ -1606,6 +1606,7 @@ lwgeom_remove_repeated_points_in_place(LWGEOM *geom, double tolerance)
        {
                /* No-op! Cannot remote points */
                case POINTTYPE:
+               case TRIANGLETYPE:
                        return;
                case LINETYPE:
                {
@@ -1705,6 +1706,7 @@ lwgeom_remove_repeated_points_in_place(LWGEOM *geom, double tolerance)
                /* Can process most multi* types as generic collection */
                case MULTILINETYPE:
                case MULTIPOLYGONTYPE:
+               case TINTYPE:
                case COLLECTIONTYPE:
                /* Curve types we mostly ignore, but allow the linear */
                /* portions to be processed by recursing into them */
@@ -1749,8 +1751,9 @@ lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed)
 {
        switch (geom->type)
        {
-               /* No-op! Cannot simplify points */
+               /* No-op! Cannot simplify points or triangles */
                case POINTTYPE:
+               case TRIANGLETYPE:
                        return;
                case LINETYPE:
                {
@@ -1809,6 +1812,7 @@ lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed)
                case MULTIPOINTTYPE:
                case MULTILINETYPE:
                case MULTIPOLYGONTYPE:
+               case TINTYPE:
                case COLLECTIONTYPE:
                {
                        uint32_t i, j = 0;
@@ -2154,6 +2158,7 @@ lwgeom_grid_in_place(LWGEOM *geom, const gridspec *grid)
                        return;
                }
                case CIRCSTRINGTYPE:
+               case TRIANGLETYPE:
                case LINETYPE:
                {
                        LWLINE *ln = (LWLINE*)(geom);
@@ -2207,6 +2212,7 @@ lwgeom_grid_in_place(LWGEOM *geom, const gridspec *grid)
                case MULTIPOINTTYPE:
                case MULTILINETYPE:
                case MULTIPOLYGONTYPE:
+               case TINTYPE:
                case COLLECTIONTYPE:
                case COMPOUNDTYPE:
                {
index 40922beec22ba62462db5744aa833da5e40bfa93..f160430589e0f658bda873d2073d57b5e2778f28 100644 (file)
@@ -754,12 +754,14 @@ Datum topologypreservesimplify(PG_FUNCTION_ARGS)
        double  tolerance;
        GEOSGeometry *g1, *g3;
        GSERIALIZED *result;
+       uint32_t type;
 
        geom1 = PG_GETARG_GSERIALIZED_P(0);
        tolerance = PG_GETARG_FLOAT8(1);
 
        /* Empty.Simplify() == Empty */
-       if ( gserialized_is_empty(geom1) )
+       type = gserialized_get_type(geom1);
+       if ( gserialized_is_empty(geom1) || type == TINTYPE || type == TRIANGLETYPE )
                PG_RETURN_POINTER(geom1);
 
        initGEOS(lwpgnotice, lwgeom_geos_error);