From: Paul Ramsey Date: Tue, 14 May 2019 21:33:40 +0000 (+0000) Subject: Simple TIN support to allow viz in QGIS X-Git-Tag: 2.5.3~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce42645ff5c806680094831975df88b68af190b1;p=postgis Simple TIN support to allow viz in QGIS References #4380 git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@17437 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/NEWS b/NEWS index 031bbd196..4e2d351eb 100644 --- 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 diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c index 52aa09675..fac662d7e 100644 --- a/liblwgeom/lwgeom.c +++ b/liblwgeom/lwgeom.c @@ -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: { diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 40922beec..f16043058 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -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);