[postgis-tickets] r17438 - Simple TIN support to allow viz in QGIS

Paul Ramsey pramsey at cleverelephant.ca
Wed May 15 07:07:33 PDT 2019


Author: pramsey
Date: 2019-05-15 07:07:33 -0700 (Wed, 15 May 2019)
New Revision: 17438

Modified:
   trunk/liblwgeom/lwgeom.c
   trunk/postgis/lwgeom_geos.c
Log:
Simple TIN support to allow viz in QGIS
Closes #4380


Modified: trunk/liblwgeom/lwgeom.c
===================================================================
--- trunk/liblwgeom/lwgeom.c	2019-05-14 21:33:40 UTC (rev 17437)
+++ trunk/liblwgeom/lwgeom.c	2019-05-15 14:07:33 UTC (rev 17438)
@@ -1547,6 +1547,7 @@
 	{
 		/* No-op! Cannot remote points */
 		case POINTTYPE:
+		case TRIANGLETYPE:
 			return;
 		case LINETYPE:
 		{
@@ -1646,6 +1647,7 @@
 		/* 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 */
@@ -1690,8 +1692,9 @@
 {
 	switch (geom->type)
 	{
-		/* No-op! Cannot simplify points */
+		/* No-op! Cannot simplify points or triangles */
 		case POINTTYPE:
+		case TRIANGLETYPE:
 			return;
 		case LINETYPE:
 		{
@@ -1750,6 +1753,7 @@
 		case MULTIPOINTTYPE:
 		case MULTILINETYPE:
 		case MULTIPOLYGONTYPE:
+		case TINTYPE:
 		case COLLECTIONTYPE:
 		{
 			uint32_t i, j = 0;
@@ -2096,6 +2100,7 @@
 			return;
 		}
 		case CIRCSTRINGTYPE:
+		case TRIANGLETYPE:
 		case LINETYPE:
 		{
 			LWLINE *ln = (LWLINE*)(geom);
@@ -2149,6 +2154,7 @@
 		case MULTIPOINTTYPE:
 		case MULTILINETYPE:
 		case MULTIPOLYGONTYPE:
+		case TINTYPE:
 		case COLLECTIONTYPE:
 		case COMPOUNDTYPE:
 		{

Modified: trunk/postgis/lwgeom_geos.c
===================================================================
--- trunk/postgis/lwgeom_geos.c	2019-05-14 21:33:40 UTC (rev 17437)
+++ trunk/postgis/lwgeom_geos.c	2019-05-15 14:07:33 UTC (rev 17438)
@@ -902,12 +902,14 @@
 	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);



More information about the postgis-tickets mailing list