4

Faced such a problem (or maybe it's a bug). I get different results when using the ST_Simplify function in PostGIS 3.0.0 and PostGIS 2.5.3.

There are source data that are simplified by using a query:

SELECT ST_Simplify(geometry, 20) FROM source_table

For verification, I created two databases on different OS. PostgreSQL11-PostGIS-3 and PostgreSQL11-PostgiGIS-2.5 with the same data mapping and SRID.

Result:

Postgis 2.5.3 enter image description here enter image description here

Postgis 3.0.0enter image description here

PostGIS 3 lost a lot of small hole geometries, although the source data and the request are the same. Why is this happening and how to fix it in PostGIS-3?

Update

Yes, SRID 3857 in both cases.

I try ST_Simplify(geometry, 20, false) and ST_Simplify(geometry, 20, true) in Postgis 3 it did not help.

Postgis_full_version(); POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="110" GEOS="3.7.2-CAPI-1.11.2 b55d2125" PROJ="Rel. 5.2.0, September 15th, 2018" LIBXML="2.9.4" LIBJSON="0.13.1" LIBPROTOBUF="1.3.1" WAGYU="0.4.3 (Internal)"

11
  • 1
    As per documentation, there is no change in ST_Siplify function between 2.5 and 3.0. Maybe a bug? Maybe try to call this function with preserveCollapsed parameter set to true. Or did you try ST_SimlifyVW? By my experiences, it produces better results...
    – DavidP
    Commented Feb 21, 2020 at 6:21
  • 1
    There are some changes in handling the 3rd parameter (github.com/postgis/postgis/commit/…). Should be set to false by default for 2.5 as well as for 3.0, but I'm not a C expert. Definitely a thing to try...
    – DavidP
    Commented Feb 21, 2020 at 7:05
  • 2
    It would be much easier to test if you could provide some test data. Are you sure about having data in same SRID in both databases?
    – user30184
    Commented Feb 21, 2020 at 9:18
  • 1
    do you get the same results for different runs on both versions?
    – geozelot
    Commented Feb 21, 2020 at 10:48
  • @user30184 yes same SRID in both databases Commented Feb 21, 2020 at 10:58

1 Answer 1

4

Bug #4568: Oversimplification of polygon inner rings in ST_Simplify was fixed in PostGIS 3.0.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.