[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0alpha2-39-geedc336

git at osgeo.org git at osgeo.org
Mon Aug 3 06:54:20 PDT 2020


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  eedc33684e18b292091d033da53f2ba734a15e23 (commit)
       via  377b845629355299c536d851e33a3b4ca9644ca5 (commit)
      from  95a3cf4c9dcd04977bf2ff1ed700156694a43344 (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 eedc33684e18b292091d033da53f2ba734a15e23
Author: Raúl Marín <git at rmr.ninja>
Date:   Mon Aug 3 13:28:54 2020 +0200

    Normalize for OverlayNG
    
    References #4730

diff --git a/regress/core/mvt.sql b/regress/core/mvt.sql
index d0513ca..c813d84 100644
--- a/regress/core/mvt.sql
+++ b/regress/core/mvt.sql
@@ -269,10 +269,10 @@ SELECT 'PG42 - OFF', ST_AsText(ST_AsMVTGeom(
 	10, 0, false));
 
 -- Invalid polygon (intersection)
-SELECT 'PG43 - ON ', ST_AsText(ST_AsMVTGeom(
+SELECT 'PG43 - ON ', ST_AsText(ST_Normalize(ST_AsMVTGeom(
 	ST_GeomFromText('POLYGON((-10 -10, 110 110, -10 110, 110 -10, -10 -10))'),
 	ST_MakeBox2D(ST_Point(0, 0), ST_Point(100, 100)),
-	10, 0, true));
+	10, 0, true)));
 
 SELECT 'PG43 - OFF', ST_AsText(ST_AsMVTGeom(
 	ST_GeomFromText('POLYGON((-10 -10, 110 110, -10 110, 110 -10, -10 -10))'),
@@ -365,13 +365,13 @@ SELECT 'PG56', ST_AsText(ST_AsMVTGeom(
 -- Different round behaviour between geos and wagyu
 WITH geometry AS
 (
-    SELECT ST_AsText(ST_AsMVTGeom(
+    SELECT ST_AsText(ST_Normalize(ST_AsMVTGeom(
 	ST_GeomFromText('POLYGON((0 0, 0 99, 1 101, 100 100, 100 0, 0 0))'),
 	ST_MakeBox2D(ST_Point(0, 0), ST_Point(100, 100)),
-	100, 0, true)) as g
+	100, 0, true))) as g
 )
 SELECT 'PG57',
-        g = 'POLYGON((100 0,100 100,0 100,0 1,1 0,100 0))' OR g = 'POLYGON((0 1,0 0,100 0,100 100,0 100,0 1))'
+        g = 'POLYGON((0 1,0 100,100 100,100 0,1 0,0 1))' OR g = 'POLYGON((0 0,0 1,0 100,100 100,100 0,0 0))'
 FROM geometry;
 
 -- Geometrycollection test
diff --git a/regress/core/mvt_expected b/regress/core/mvt_expected
index e88d4b0..ece6d12 100644
--- a/regress/core/mvt_expected
+++ b/regress/core/mvt_expected
@@ -49,7 +49,7 @@ 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)
 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|
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index fb6cda3..83a0ff1 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -792,9 +792,9 @@ SELECT '#2412', ST_AsText(ST_LineToCurve('LINESTRING(0 0,10 0,20 0)'));
 SELECT '#2420.1', ST_AsText(ST_LineToCurve('LINESTRING(0 0,10 0,10 10,0 10,0 0)'));
 SELECT '#2420.2', ST_AsText(ST_LineToCurve('LINESTRING(0 0,10 0,10 10,0 10)'));
 
-SELECT '#2423', ST_AsText(ST_Normalize(ST_CurveToLine(ST_LineToCurve(
-  ST_Intersection(ST_Buffer(ST_Point(0,0),10),ST_MakeEnvelope(-10,0,10,10))
-), 4)), 3);
+SELECT '#2423', ST_AsText(ST_CurveToLine(ST_LineToCurve(
+    ST_Normalize(ST_Intersection(ST_Buffer(ST_Point(0,0),10),ST_MakeEnvelope(-10,0,10,10)))
+), 4), 3);
 
 SELECT '#2424', ST_AsText(ST_SnapToGrid(ST_CurveToLine(
   'MULTICURVE(COMPOUNDCURVE((0 0, 10 0),CIRCULARSTRING(10 0, 20 1, 30 10)))',

commit 377b845629355299c536d851e33a3b4ca9644ca5
Author: Raúl Marín <git at rmr.ninja>
Date:   Mon Aug 3 13:30:12 2020 +0200

    cu_split: Improve format to ease debugging

diff --git a/liblwgeom/cunit/cu_split.c b/liblwgeom/cunit/cu_split.c
index 6481c63..0a81bdf 100644
--- a/liblwgeom/cunit/cu_split.c
+++ b/liblwgeom/cunit/cu_split.c
@@ -83,177 +83,154 @@ static void test_lwgeom_split(void)
 	LWGEOM *geom, *blade, *ret;
 	char *wkt, *in_wkt;
 
-	geom = lwgeom_from_wkt(
-"MULTILINESTRING((-5 -2,0 0),(0 0,10 10))",
-	LW_PARSER_CHECK_NONE);
+	geom = lwgeom_from_wkt("MULTILINESTRING((-5 -2,0 0),(0 0,10 10))", LW_PARSER_CHECK_NONE);
 	CU_ASSERT(geom != NULL);
-	blade = lwgeom_from_wkt(
-		"POINT(0 0)",
-		LW_PARSER_CHECK_NONE);
+	blade = lwgeom_from_wkt("POINT(0 0)", LW_PARSER_CHECK_NONE);
 	CU_ASSERT(blade != NULL);
 	ret = lwgeom_split(geom, blade);
 	CU_ASSERT(ret != NULL);
 	wkt = lwgeom_to_ewkt(ret);
 	in_wkt = "GEOMETRYCOLLECTION(LINESTRING(-5 -2,0 0),LINESTRING(0 0,10 10))";
-        if (strcmp(in_wkt, wkt))
-                fprintf(stderr, "\nExp:  %s\nObt:  %s\n", in_wkt, wkt);
-	CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
+	ASSERT_STRING_EQUAL(wkt, in_wkt);
 	lwfree(wkt);
 	lwgeom_free(ret);
 	lwgeom_free(geom);
 	lwgeom_free(blade);
 
         /* See #1311 */
-        geom = lwgeom_from_wkt(
-                "LINESTRING(0 0,10 0,20 4,0 3)",
-                LW_PARSER_CHECK_NONE);
-        CU_ASSERT(geom != NULL);
-        blade = lwgeom_from_wkt("POINT(10 0)", LW_PARSER_CHECK_NONE);
-        ret = lwgeom_split(geom, blade);
-        CU_ASSERT(ret != NULL);
-        wkt = lwgeom_to_ewkt(ret);
+	geom = lwgeom_from_wkt("LINESTRING(0 0,10 0,20 4,0 3)", LW_PARSER_CHECK_NONE);
+	CU_ASSERT(geom != NULL);
+	blade = lwgeom_from_wkt("POINT(10 0)", LW_PARSER_CHECK_NONE);
+	ret = lwgeom_split(geom, blade);
+	CU_ASSERT(ret != NULL);
+	wkt = lwgeom_to_ewkt(ret);
 	in_wkt = "GEOMETRYCOLLECTION(LINESTRING(0 0,10 0),LINESTRING(10 0,20 4,0 3))";
-        if (strcmp(in_wkt, wkt))
-                fprintf(stderr, "\nExp:  %s\nObt:  %s\n", in_wkt, wkt);
-        CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
-        lwfree(wkt);
+	ASSERT_STRING_EQUAL(wkt, in_wkt);
+	lwfree(wkt);
 	lwgeom_free(ret);
 	lwgeom_free(geom);
 	lwgeom_free(blade);
 
   /* See #2528 (1) -- memory leak test, needs valgrind to check */
-  geom = lwgeom_from_wkt("SRID=1;LINESTRING(0 1,10 1)", LW_PARSER_CHECK_NONE);
-  CU_ASSERT(geom != NULL);
-  blade = lwgeom_from_wkt("LINESTRING(7 0,7 3)", LW_PARSER_CHECK_NONE);
-  ret = lwgeom_split(geom, blade);
-  CU_ASSERT(ret != NULL);
-  wkt = lwgeom_to_ewkt(ret);
+	geom = lwgeom_from_wkt("SRID=1;LINESTRING(0 1,10 1)", LW_PARSER_CHECK_NONE);
+	CU_ASSERT(geom != NULL);
+	blade = lwgeom_from_wkt("LINESTRING(7 0,7 3)", LW_PARSER_CHECK_NONE);
+	ret = lwgeom_split(geom, blade);
+	CU_ASSERT(ret != NULL);
+	wkt = lwgeom_to_ewkt(ret);
 	in_wkt = "SRID=1;GEOMETRYCOLLECTION(LINESTRING(0 1,7 1),LINESTRING(7 1,10 1))";
-  if (strcmp(in_wkt, wkt))
-                fprintf(stderr, "\nExp:  %s\nObt:  %s\n", in_wkt, wkt);
-  CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
-  lwfree(wkt);
+	ASSERT_STRING_EQUAL(wkt, in_wkt);
+	lwfree(wkt);
 	lwgeom_free(ret);
 	lwgeom_free(geom);
 	lwgeom_free(blade);
 
   /* See #2528 (2) -- memory leak test, needs valgrind to check */
-  geom = lwgeom_from_wkt("SRID=1;POLYGON((0 1, 10 1, 10 10, 0 10, 0 1))", LW_PARSER_CHECK_NONE);
-  CU_ASSERT(geom != NULL);
-  blade = lwgeom_from_wkt("LINESTRING(7 0,7 20)", LW_PARSER_CHECK_NONE);
-  ret = lwgeom_split(geom, blade);
-  CU_ASSERT(ret != NULL);
-  wkt = lwgeom_to_ewkt(ret);
+	geom = lwgeom_from_wkt("SRID=1;POLYGON((0 1, 10 1, 10 10, 0 10, 0 1))", LW_PARSER_CHECK_NONE);
+	CU_ASSERT(geom != NULL);
+	blade = lwgeom_from_wkt("LINESTRING(7 0,7 20)", LW_PARSER_CHECK_NONE);
+	ret = lwgeom_split(geom, blade);
+	CU_ASSERT(ret != NULL);
+	wkt = lwgeom_to_ewkt(ret);
 	in_wkt = "SRID=1;GEOMETRYCOLLECTION(POLYGON((7 1,0 1,0 10,7 10,7 1)),POLYGON((7 10,10 10,10 1,7 1,7 10)))";
-  if (strcmp(in_wkt, wkt))
-                fprintf(stderr, "\nExp:  %s\nObt:  %s\n", in_wkt, wkt);
-  CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
-  lwfree(wkt);
+	ASSERT_STRING_EQUAL(wkt, in_wkt);
+	lwfree(wkt);
 	lwgeom_free(ret);
 	lwgeom_free(geom);
 	lwgeom_free(blade);
 
   /* Split line by multiline */
-  geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
-  CU_ASSERT_FATAL(geom != NULL);
-  blade = lwgeom_from_wkt("MULTILINESTRING((1 1,1 -1),(2 1,2 -1,3 -1,3 1))",
-    LW_PARSER_CHECK_NONE);
-  ret = lwgeom_split(geom, blade);
-  if ( ! ret ) printf("%s", cu_error_msg);
-  CU_ASSERT_FATAL(ret != NULL);
-  wkt = lwgeom_to_ewkt(ret);
-  CU_ASSERT_FATAL(wkt != NULL);
+	geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
+	CU_ASSERT_FATAL(geom != NULL);
+	blade = lwgeom_from_wkt("MULTILINESTRING((1 1,1 -1),(2 1,2 -1,3 -1,3 1))", LW_PARSER_CHECK_NONE);
+	ret = lwgeom_split(geom, blade);
+	if (!ret)
+		printf("%s", cu_error_msg);
+	CU_ASSERT_FATAL(ret != NULL);
+	wkt = lwgeom_to_ewkt(ret);
+	CU_ASSERT_FATAL(wkt != NULL);
 	in_wkt = "GEOMETRYCOLLECTION(LINESTRING(0 0,1 0),LINESTRING(1 0,2 0),LINESTRING(2 0,3 0),LINESTRING(3 0,10 0))";
-  if (strcmp(in_wkt, wkt))
-                fprintf(stderr, "\nExp:  %s\nObt:  %s\n", in_wkt, wkt);
-  CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
-  lwfree(wkt);
+	ASSERT_STRING_EQUAL(wkt, in_wkt);
+	lwfree(wkt);
 	lwgeom_free(ret);
 	lwgeom_free(geom);
 	lwgeom_free(blade);
 
   /* Split line by polygon (boundary) */
-  geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
-  CU_ASSERT_FATAL(geom != NULL);
-  blade = lwgeom_from_wkt(
-"POLYGON((1 -2,1 1,2 1,2 -1,3 -1,3 1,11 1,11 -2,1 -2))",
-    LW_PARSER_CHECK_NONE);
-  ret = lwgeom_split(geom, blade);
-  if ( ! ret ) printf("%s", cu_error_msg);
-  CU_ASSERT_FATAL(ret != NULL);
-  wkt = lwgeom_to_ewkt(ret);
-  CU_ASSERT_FATAL(wkt != NULL);
+	geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
+	CU_ASSERT_FATAL(geom != NULL);
+	blade = lwgeom_from_wkt("POLYGON((1 -2,1 1,2 1,2 -1,3 -1,3 1,11 1,11 -2,1 -2))", LW_PARSER_CHECK_NONE);
+	ret = lwgeom_split(geom, blade);
+	if (!ret)
+		printf("%s", cu_error_msg);
+	CU_ASSERT_FATAL(ret != NULL);
+	wkt = lwgeom_to_ewkt(ret);
+	CU_ASSERT_FATAL(wkt != NULL);
 	in_wkt = "GEOMETRYCOLLECTION(LINESTRING(0 0,1 0),LINESTRING(1 0,2 0),LINESTRING(2 0,3 0),LINESTRING(3 0,10 0))";
-  if (strcmp(in_wkt, wkt))
-                fprintf(stderr, "\nExp:  %s\nObt:  %s\n", in_wkt, wkt);
-  CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
-  lwfree(wkt);
+	ASSERT_STRING_EQUAL(wkt, in_wkt);
+	lwfree(wkt);
 	lwgeom_free(ret);
 	lwgeom_free(geom);
 	lwgeom_free(blade);
 
-  /* Split line by EMPTY polygon (boundary) */
-  geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
-  CU_ASSERT_FATAL(geom != NULL);
-  blade = lwgeom_from_wkt("POLYGON EMPTY", LW_PARSER_CHECK_NONE);
-  ret = lwgeom_split(geom, blade);
-  if ( ! ret ) printf("%s", cu_error_msg);
-  CU_ASSERT_FATAL(ret != NULL);
-  wkt = lwgeom_to_ewkt(ret);
-  CU_ASSERT_FATAL(wkt != NULL);
+	/* Split line by EMPTY polygon (boundary) */
+	geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
+	CU_ASSERT_FATAL(geom != NULL);
+	blade = lwgeom_from_wkt("POLYGON EMPTY", LW_PARSER_CHECK_NONE);
+	ret = lwgeom_split(geom, blade);
+	if (!ret)
+		printf("%s", cu_error_msg);
+	CU_ASSERT_FATAL(ret != NULL);
+	wkt = lwgeom_to_ewkt(ret);
+	CU_ASSERT_FATAL(wkt != NULL);
 	in_wkt = "GEOMETRYCOLLECTION(LINESTRING(0 0,10 0))";
-  if (strcmp(in_wkt, wkt))
-                fprintf(stderr, "\nExp:  %s\nObt:  %s\n", in_wkt, wkt);
-  CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
-  lwfree(wkt);
+	ASSERT_STRING_EQUAL(wkt, in_wkt);
+	lwfree(wkt);
 	lwgeom_free(ret);
 	lwgeom_free(geom);
 	lwgeom_free(blade);
 
   /* Split line by multipolygon (boundary) */
-  geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
-  CU_ASSERT_FATAL(geom != NULL);
-  blade = lwgeom_from_wkt(
-"MULTIPOLYGON(((1 -1,1 1,2 1,2 -1,1 -1)),((3 -1,3 1,11 1,11 -1,3 -1)))",
-    LW_PARSER_CHECK_NONE);
-  ret = lwgeom_split(geom, blade);
-  if ( ! ret ) printf("%s", cu_error_msg);
-  CU_ASSERT_FATAL(ret != NULL);
-  wkt = lwgeom_to_ewkt(ret);
-  CU_ASSERT_FATAL(wkt != NULL);
+	geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
+	CU_ASSERT_FATAL(geom != NULL);
+	blade = lwgeom_from_wkt("MULTIPOLYGON(((1 -1,1 1,2 1,2 -1,1 -1)),((3 -1,3 1,11 1,11 -1,3 -1)))",
+				LW_PARSER_CHECK_NONE);
+	ret = lwgeom_split(geom, blade);
+	if (!ret)
+		printf("%s", cu_error_msg);
+	CU_ASSERT_FATAL(ret != NULL);
+	wkt = lwgeom_to_ewkt(ret);
+	CU_ASSERT_FATAL(wkt != NULL);
 	in_wkt = "GEOMETRYCOLLECTION(LINESTRING(0 0,1 0),LINESTRING(1 0,2 0),LINESTRING(2 0,3 0),LINESTRING(3 0,10 0))";
-  if (strcmp(in_wkt, wkt))
-                fprintf(stderr, "\nExp:  %s\nObt:  %s\n", in_wkt, wkt);
-  CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
-  lwfree(wkt);
+	ASSERT_STRING_EQUAL(wkt, in_wkt);
+	lwfree(wkt);
 	lwgeom_free(ret);
 	lwgeom_free(geom);
 	lwgeom_free(blade);
 
-  /* Split line by multipoint */
-  geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
-  CU_ASSERT_FATAL(geom != NULL);
-  blade = lwgeom_from_wkt("MULTIPOINT(2 0,8 0,4 0)", LW_PARSER_CHECK_NONE);
-  ret = lwgeom_split(geom, blade);
-  if ( ! ret ) printf("%s", cu_error_msg);
-  CU_ASSERT_FATAL(ret != NULL);
-  wkt = lwgeom_to_ewkt(ret);
-  CU_ASSERT_FATAL(wkt != NULL);
+	/* Split line by multipoint */
+	geom = lwgeom_from_wkt("LINESTRING(0 0, 10 0)", LW_PARSER_CHECK_NONE);
+	CU_ASSERT_FATAL(geom != NULL);
+	blade = lwgeom_from_wkt("MULTIPOINT(2 0,8 0,4 0)", LW_PARSER_CHECK_NONE);
+	ret = lwgeom_split(geom, blade);
+	if (!ret)
+		printf("%s", cu_error_msg);
+	CU_ASSERT_FATAL(ret != NULL);
+	wkt = lwgeom_to_ewkt(ret);
+	CU_ASSERT_FATAL(wkt != NULL);
 	in_wkt = "GEOMETRYCOLLECTION(LINESTRING(8 0,10 0),LINESTRING(0 0,2 0),LINESTRING(4 0,8 0),LINESTRING(2 0,4 0))";
-  if (strcmp(in_wkt, wkt))
-                fprintf(stderr, "\nExp:  %s\nObt:  %s\n", in_wkt, wkt);
-  CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
-  lwfree(wkt);
+	ASSERT_STRING_EQUAL(wkt, in_wkt);
+	lwfree(wkt);
 	lwgeom_free(ret);
 	lwgeom_free(geom);
 	lwgeom_free(blade);
 
-  /* See #3401 -- robustness issue */
-  geom = lwgeom_from_wkt("LINESTRING(-180 0,0 0)", LW_PARSER_CHECK_NONE);
-  CU_ASSERT(geom != NULL);
-  blade = lwgeom_from_wkt("POINT(-20 0)", LW_PARSER_CHECK_NONE);
-  ret = lwgeom_split(geom, blade);
-  CU_ASSERT(ret != NULL);
+	/* See #3401 -- robustness issue */
+	geom = lwgeom_from_wkt("LINESTRING(-180 0,0 0)", LW_PARSER_CHECK_NONE);
+	CU_ASSERT(geom != NULL);
+	blade = lwgeom_from_wkt("POINT(-20 0)", LW_PARSER_CHECK_NONE);
+	ret = lwgeom_split(geom, blade);
+	CU_ASSERT(ret != NULL);
 	{
 		LWCOLLECTION *split = lwgeom_as_lwcollection(ret);
 		LWLINE *l1, *l2;

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

Summary of changes:
 liblwgeom/cunit/cu_split.c | 205 ++++++++++++++++++++-------------------------
 regress/core/mvt.sql       |  10 +--
 regress/core/mvt_expected  |   2 +-
 regress/core/tickets.sql   |   6 +-
 4 files changed, 100 insertions(+), 123 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list