Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#4837 closed defect (fixed)

GEOS 3.10dev failure on make valid

Reported by: robe Owned by: robe
Priority: blocker Milestone: PostGIS 3.2.0
Component: postgis Version: master
Keywords: Cc:

Description

Just noticed this failing on Winnie. She's running with GEOS 3.10dev. PostGIS 3.1 branch which runs against GEOS 3.9 branch is fine, so assume this is just a change in 3.10 dev

  Test: test_geos_makevalid ...FAILED
    1. cu_geos.c:157  - ASSERT_STRING_EQUAL
	* Expected: POLYGON((92127.546 463452.075,92117.173 463439.755,92133.675 463425.942,92122.136 463412.826,92092.377 463437.77,92114.014 463463.469,92115.512 463462.207,92115.51207431706 463462.2069374289,92127.546 463452.075))
	* Obtained: POLYGON((92115.512 463462.207,92115.51207431706 463462.2069374289,92127.546 463452.075,92117.173 463439.755,92133.675 463425.942,92122.136 463412.826,92092.377 463437.77,92114.014 463463.469,92115.512 463462.207))

Change History (8)

comment:1 by robe, 4 years ago

Owner: changed from pramsey to robe

fixing locally — lwgeom_normalize does the trick.

Also this one:

 ./regress/core/fixedoverlay .. failed (diff expected obtained: /projects/postgis/tmp/3.2.0dev_pg13_geos3.10_gdal3.2.0w64/test_102_diff)
-----------------------------------------------------------------------------
--- ./regress/core/fixedoverlay_expected        2020-12-19 10:07:22.883500200 -0500
+++ /projects/postgis/tmp/3.2.0dev_pg13_geos3.10_gdal3.2.0w64/test_102_out     2021-02-11 12:34:46.349198300 -0500
@@ -5,5 +5,4 @@
 unaryunion|MULTILINESTRING((0 0,8 0),(8 0,10 0),(10 0,14 0))
 subdivide|POLYGON((0 10,10 10,10 0,0 0,0 10))
 subdivide|POLYGON((10 6,100 6,100 4,10 6))
-subdivide|POLYGON((100 4,110 4,110 0,100 0,100 4))
-subdivide|POLYGON((100 10,110 10,110 4,100 4,100 10))
+subdivide|POLYGON((100 10,110 10,110 0,100 0,100 10))
-----------------------------------------------------------------------------

According to @dbaston probably caused by - https://github.com/libgeos/geos/commit/701e4900c432127c0b2f5a0b2462a51d92fbef8b

comment:2 by robe, 4 years ago

Okay the subdivide case is not a trivial fix with normalize:

I tried changing the query to this in hopes that GEOS 3.9 and GEOS 3.10 would agree:

SELECT 'subdivide', ST_AsText(geomn)
FROM ST_Subdivide(
	'POLYGON((0 0,0 10,10 10,10 6,100 5.1, 100 10, 110 10, 110 0, 100 0,100 4.9,10 5,10 0,0 0))'::geometry,
5, 2) AS geom, ST_Normalize(geom) AS geomn
ORDER BY geomn;

— 3.9.0 answer (haven't upgraded to 3.9.1 yet on my prod)

subdivide	POLYGON((0 0,0 10,10 10,10 0,0 0))
subdivide	POLYGON((100 4,100 10,110 10,110 4,100 4))
subdivide	POLYGON((10 6,100 6,100 4,10 6))
subdivide	POLYGON((100 0,100 4,110 4,110 0,100 0))

— 3.10 (I forget what vintage — going to upgrade in a bit to see if it helps)

subdivide	POLYGON((0 0,0 10,10 10,10 0,0 0))
subdivide	POLYGON((100 0,100 10,110 10,110 0,100 0))
subdivide	POLYGON((10 6,100 6,100 4,10 6))

comment:3 by robe, 4 years ago

grrh my commit did not come thru [5e310cf6ad646702e5574eb3aa2391021dcdd8c5/git]

comment:4 by robe, 4 years ago

Sadly change the 5 to 6 like so though number of polygons agrees, output is different.

For this test both have 3 polygons but second polygon is different

SELECT 'subdivide', ST_AsText(geomn)
FROM ST_Subdivide(
	'POLYGON((0 0,0 10,10 10,10 6,100 5.1, 100 10, 110 10, 110 0, 100 0,100 4.9,10 5,10 0,0 0))'::geometry,
6, 2) AS geom, ST_Normalize(geom) AS geomn
ORDER BY geomn;

— 3.9.0 answer is

subdivide	POLYGON((0 0,0 10,10 10,10 0,0 0))
subdivide	POLYGON((100 0,100 4,100 10,110 10,110 0,100 0))
subdivide	POLYGON((10 6,100 6,100 4,10 6))

— 3.10dev answer is

subdivide	POLYGON((0 0,0 10,10 10,10 0,0 0))
subdivide	POLYGON((100 0,100 10,110 10,110 0,100 0))
subdivide	POLYGON((10 6,100 6,100 4,10 6))
-subdivide|POLYGON((100 0,100 4,100 10,110 10,110 0,100 0))
+subdivide|POLYGON((100 0,100 10,110 10,110 0,100 0))

comment:5 by Regina Obe <lr@…>, 4 years ago

In d52fc5c/git:

Revise subdivide test so both geos 3.9 and geos 3.10 agree on same answer. References #4837 for PostGIS 3.2

comment:6 by robe, 4 years ago

Resolution: fixed
Status: newclosed

comment:7 by robe, 4 years ago

Summary: GEOS 3.10dev failure on make valid - winnieGEOS 3.10dev failure on make valid

comment:8 by Regina Obe <lr@…>, 4 years ago

In d7d8dfb/git:

cunit makevalid make work for 3.9.2dev and 3.10 as well. Closes #4875 References #4837

Note: See TracTickets for help on using tickets.