[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-497-g9903f54

git at osgeo.org git at osgeo.org
Thu Sep 2 14:05:22 PDT 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  9903f546f0087c9bd135d483b8ad74a8e987c5b6 (commit)
       via  0c09010bd18ff28851554639270162ec3ad2c508 (commit)
       via  8a075c133407ddc5ec35231e4bc7a0e2c0d7df57 (commit)
       via  14afc48bfab0f64320d87ecf8f4445224b19eab8 (commit)
      from  b4387f1810a25185e0b250e794a4ab40ba78f7bc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9903f546f0087c9bd135d483b8ad74a8e987c5b6
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Thu Sep 2 23:59:15 2021 +0300

    NEWS for non-simplifying ST_AsMVTGeom.

diff --git a/NEWS b/NEWS
index be39bd8..7c5d0fa 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ PostGIS 3.2.0
   - #4824, Removed `--without-wagyu` build option. Using Wagyu is now mandatory to build with MVT support.
   - #4933, topology.GetFaceByPoint will not work with topologies having invalid edge linking.
   - #4981, ST_StartPoint support any geometry. No longer returns null for non-linestrings.
+  - #4149, ST_AsMVTGeom now preserves more of original geometry's details at scale close to target extent.
+           If you need previous simplifying behaviour, you can ST_Simplify the geometry in advance.
+           (Darafei Praliaskouski)
 
  * Enhancements *
   - #2592, Do not allow CreateTopology to define topologies with SRID < 0

commit 0c09010bd18ff28851554639270162ec3ad2c508
Merge: b4387f1 8a075c1
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Thu Sep 2 23:46:59 2021 +0300

    Zero tolerance simplification in MVT export.
    
    Closes #4149
    Closes https://github.com/postgis/postgis/pull/463


commit 8a075c133407ddc5ec35231e4bc7a0e2c0d7df57
Merge: 18ce69f 14afc48
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Thu Sep 2 22:26:20 2021 +0300

    Merge 14afc48bfab0f64320d87ecf8f4445224b19eab8 into 18ce69feba33b13d9fc6122dd594669d9b1bb977

diff --cc regress/core/mvt_expected
index b53be37,da0a9ac..9b6e5c1
--- a/regress/core/mvt_expected
+++ b/regress/core/mvt_expected
@@@ -45,11 -45,11 +45,11 @@@ PG38
  PG39|t
  PG40 - ON |LINESTRING(0 10,0 0)
  PG40 - OFF|LINESTRING(0 10,0 0)
- PG41 - ON |LINESTRING(0 10,0 4,0 2,0 0,1 0)
- PG41 - OFF|LINESTRING(0 10,0 4,0 2,0 0,1 0)
+ PG41 - ON |LINESTRING(0 10,0 0,1 0)
+ PG41 - OFF|LINESTRING(0 10,0 0,1 0)
  PG42 - ON |LINESTRING(0 10,0 0,1 0)
  PG42 - OFF|LINESTRING(0 10,0 0,1 0)
 -PG43 - ON |MULTIPOLYGON(((5 5,0 0,10 0,5 5)),((5 5,10 10,0 10,5 5)))
 +PG43 - ON |MULTIPOLYGON(((0 10,10 10,5 5,0 10)),((0 0,5 5,10 0,0 0)))
  PG43 - OFF|MULTIPOLYGON(((5 5,-1 -1,11 -1,5 5)),((5 5,11 11,-1 11,5 5)))
  PG44|
  PG45|

commit 14afc48bfab0f64320d87ecf8f4445224b19eab8
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Sun Aug 18 16:14:20 2019 +0300

    Zero tolerance simplification in MVT export

diff --git a/postgis/mvt.c b/postgis/mvt.c
index e1fc085..8733823 100644
--- a/postgis/mvt.c
+++ b/postgis/mvt.c
@@ -1180,7 +1180,7 @@ LWGEOM *mvt_geom(LWGEOM *lwgeom, const GBOX *gbox, uint32_t extent, uint32_t buf
 	gridspec grid = {0, 0, 0, 0, 1, 1, 0, 0};
 	double width = gbox->xmax - gbox->xmin;
 	double height = gbox->ymax - gbox->ymin;
-	double resx, resy, res, fx, fy;
+	double fx, fy;
 	const uint8_t basic_type = lwgeom_get_basic_type(lwgeom);
 	int preserve_collapsed = LW_FALSE;
 	POSTGIS_DEBUG(2, "mvt_geom called");
@@ -1192,16 +1192,9 @@ LWGEOM *mvt_geom(LWGEOM *lwgeom, const GBOX *gbox, uint32_t extent, uint32_t buf
 	if (lwgeom_is_empty(lwgeom))
 		return NULL;
 
-	resx = width / extent;
-	resy = height / extent;
-	res = (resx < resy ? resx : resy)/2;
 	fx = extent / width;
 	fy = -(extent / height);
 
-	/* Remove all non-essential points (under the output resolution) */
-	lwgeom_remove_repeated_points_in_place(lwgeom, res);
-	lwgeom_simplify_in_place(lwgeom, res, preserve_collapsed);
-
 	/* If geometry has disappeared, you're done */
 	if (lwgeom_is_empty(lwgeom))
 		return NULL;
@@ -1217,6 +1210,13 @@ LWGEOM *mvt_geom(LWGEOM *lwgeom, const GBOX *gbox, uint32_t extent, uint32_t buf
 	/* Snap to integer precision, removing duplicate points */
 	lwgeom_grid_in_place(lwgeom, &grid);
 
+	/* Remove points on straight lines */
+	lwgeom_simplify_in_place(lwgeom, 0, preserve_collapsed);
+
+	/* Remove duplicates in multipoints */
+	if (lwgeom->type == MULTIPOINTTYPE)
+		lwgeom_remove_repeated_points_in_place(lwgeom, 0);
+
 	if (!lwgeom || lwgeom_is_empty(lwgeom))
 		return NULL;
 
diff --git a/regress/core/mvt_expected b/regress/core/mvt_expected
index e88d4b0..da0a9ac 100644
--- a/regress/core/mvt_expected
+++ b/regress/core/mvt_expected
@@ -45,8 +45,8 @@ PG38|
 PG39|t
 PG40 - ON |LINESTRING(0 10,0 0)
 PG40 - OFF|LINESTRING(0 10,0 0)
-PG41 - ON |LINESTRING(0 10,0 4,0 2,0 0,1 0)
-PG41 - OFF|LINESTRING(0 10,0 4,0 2,0 0,1 0)
+PG41 - ON |LINESTRING(0 10,0 0,1 0)
+PG41 - OFF|LINESTRING(0 10,0 0,1 0)
 PG42 - ON |LINESTRING(0 10,0 0,1 0)
 PG42 - OFF|LINESTRING(0 10,0 0,1 0)
 PG43 - ON |MULTIPOLYGON(((5 5,0 0,10 0,5 5)),((5 5,10 10,0 10,5 5)))

-----------------------------------------------------------------------

Summary of changes:
 NEWS                      |  3 +++
 postgis/mvt.c             | 16 ++++++++--------
 regress/core/mvt_expected |  4 ++--
 3 files changed, 13 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list