Skip to content

Fixed #32544 -- Confirmed support for GDAL 3.2 and GEOS 3.9.#14212

Merged
felixxm merged 1 commit intodjango:mainfrom
claudep:geosgdal
Apr 7, 2021
Merged

Fixed #32544 -- Confirmed support for GDAL 3.2 and GEOS 3.9.#14212
felixxm merged 1 commit intodjango:mainfrom
claudep:geosgdal

Conversation

@claudep
Copy link
Copy Markdown
Member

@claudep claudep commented Apr 3, 2021

No description provided.

@claudep
Copy link
Copy Markdown
Member Author

claudep commented Apr 3, 2021

I deliberately mostly kept using assertTrue instead of assertIs, because we are not testing here if geometry.equals() returns a boolean or not, we know it does and therefore we should be able to use assertTrue safely.

@claudep
Copy link
Copy Markdown
Member Author

claudep commented Apr 3, 2021

Oh, and we should also discuss the backport to 3.2, as the only changes are in tests.

@felixxm
Copy link
Copy Markdown
Member

felixxm commented Apr 7, 2021

@claudep Thanks for this patch 👍 I checked locally with GDAL 3.2.2 and GEOS 3.9.1 and still have some failures:

Details
======================================================================
ERROR: test_closepolygons (gis_tests.gdal_tests.test_geom.OGRGeomTest)
Testing closing Polygon objects.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 258, in test_closepolygons
    self.assertEqual(OGRGeometry('POINT(2.5 2.5)'), poly.centroid)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 631, in centroid
    capi.get_centroid(self.ptr, p.ptr)
  File "/repo/django/django/contrib/gis/gdal/prototypes/errcheck.py", line 117, in check_errcode
    check_err(result, cpl=cpl)
  File "/repo/django/django/contrib/gis/gdal/error.py", line 59, in check_err
    raise e(msg)
django.contrib.gis.gdal.error.GDALException: OGR failure.

======================================================================
ERROR: test_difference (gis_tests.gdal_tests.test_geom.OGRGeomTest)
Testing difference().
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 380, in test_difference
    d2 = a.difference(b)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 477, in difference
    return self._geomgen(capi.geom_diff, other)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 455, in _geomgen
    return OGRGeometry(gen_func(self.ptr, other.ptr), self.srs)
  File "/repo/django/django/contrib/gis/gdal/prototypes/errcheck.py", line 83, in check_geom
    raise GDALException('Invalid geometry pointer returned from "%s".' % func.__name__)
django.contrib.gis.gdal.error.GDALException: Invalid geometry pointer returned from "OGR_G_Difference".

======================================================================
ERROR: test_intersection (gis_tests.gdal_tests.test_geom.OGRGeomTest)
Testing intersects() and intersection().
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 393, in test_intersection
    i2 = a.intersection(b)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 484, in intersection
    return self._geomgen(capi.geom_intersection, other)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 455, in _geomgen
    return OGRGeometry(gen_func(self.ptr, other.ptr), self.srs)
  File "/repo/django/django/contrib/gis/gdal/prototypes/errcheck.py", line 83, in check_geom
    raise GDALException('Invalid geometry pointer returned from "%s".' % func.__name__)
django.contrib.gis.gdal.error.GDALException: Invalid geometry pointer returned from "OGR_G_Intersection".

======================================================================
ERROR: test_polygons (gis_tests.gdal_tests.test_geom.OGRGeomTest)
Testing Polygon objects.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 223, in test_polygons
    x, y = poly.centroid.tuple
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 631, in centroid
    capi.get_centroid(self.ptr, p.ptr)
  File "/repo/django/django/contrib/gis/gdal/prototypes/errcheck.py", line 117, in check_errcode
    check_err(result, cpl=cpl)
  File "/repo/django/django/contrib/gis/gdal/error.py", line 59, in check_err
    raise e(msg)
django.contrib.gis.gdal.error.GDALException: OGR failure.

======================================================================
ERROR: test_srs (gis_tests.gdal_tests.test_geom.OGRGeomTest)
Testing OGR Geometries with Spatial Reference objects.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 300, in test_srs
    diff = a.difference(b)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 477, in difference
    return self._geomgen(capi.geom_diff, other)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 455, in _geomgen
    return OGRGeometry(gen_func(self.ptr, other.ptr), self.srs)
  File "/repo/django/django/contrib/gis/gdal/prototypes/errcheck.py", line 83, in check_geom
    raise GDALException('Invalid geometry pointer returned from "%s".' % func.__name__)
django.contrib.gis.gdal.error.GDALException: Invalid geometry pointer returned from "OGR_G_Difference".

======================================================================
ERROR: test_symdifference (gis_tests.gdal_tests.test_geom.OGRGeomTest)
Testing sym_difference().
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 405, in test_symdifference
    d2 = a.sym_difference(b)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 491, in sym_difference
    return self._geomgen(capi.geom_sym_diff, other)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 455, in _geomgen
    return OGRGeometry(gen_func(self.ptr, other.ptr), self.srs)
  File "/repo/django/django/contrib/gis/gdal/prototypes/errcheck.py", line 83, in check_geom
    raise GDALException('Invalid geometry pointer returned from "%s".' % func.__name__)
django.contrib.gis.gdal.error.GDALException: Invalid geometry pointer returned from "OGR_G_SymmetricDifference".

======================================================================
ERROR: test_union (gis_tests.gdal_tests.test_geom.OGRGeomTest)
Testing union().
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 417, in test_union
    u2 = a.union(b)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 498, in union
    return self._geomgen(capi.geom_union, other)
  File "/repo/django/django/contrib/gis/gdal/geometries.py", line 455, in _geomgen
    return OGRGeometry(gen_func(self.ptr, other.ptr), self.srs)
  File "/repo/django/django/contrib/gis/gdal/prototypes/errcheck.py", line 83, in check_geom
    raise GDALException('Invalid geometry pointer returned from "%s".' % func.__name__)
django.contrib.gis.gdal.error.GDALException: Invalid geometry pointer returned from "OGR_G_Union".

======================================================================
FAIL: test_contains (gis_tests.gdal_tests.test_geom.OGRGeomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 511, in test_contains
    self.assertIs(OGRGeometry('POINT(0 0)').contains(OGRGeometry('POINT(0 0)')), True)
  File "/usr/lib/python3.8/unittest/case.py", line 1193, in assertIs
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: False is not True

======================================================================
FAIL: test_crosses (gis_tests.gdal_tests.test_geom.OGRGeomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 515, in test_crosses
    self.assertIs(OGRGeometry('LINESTRING(0 0, 1 1)').crosses(OGRGeometry('LINESTRING(0 1, 1 0)')), True)
  File "/usr/lib/python3.8/unittest/case.py", line 1193, in assertIs
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: False is not True

======================================================================
FAIL: test_disjoint (gis_tests.gdal_tests.test_geom.OGRGeomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 520, in test_disjoint
    self.assertIs(OGRGeometry('LINESTRING(0 0, 0 1)').disjoint(OGRGeometry('LINESTRING(1 0, 1 1)')), True)
  File "/usr/lib/python3.8/unittest/case.py", line 1193, in assertIs
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: False is not True

======================================================================
FAIL: test_equals (gis_tests.gdal_tests.test_geom.OGRGeomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 523, in test_equals
    self.assertIs(OGRGeometry('POINT(0 0)').contains(OGRGeometry('POINT(0 0)')), True)
  File "/usr/lib/python3.8/unittest/case.py", line 1193, in assertIs
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: False is not True

======================================================================
FAIL: test_overlaps (gis_tests.gdal_tests.test_geom.OGRGeomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 531, in test_overlaps
    self.assertIs(
  File "/usr/lib/python3.8/unittest/case.py", line 1193, in assertIs
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: False is not True

======================================================================
FAIL: test_touches (gis_tests.gdal_tests.test_geom.OGRGeomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 539, in test_touches
    self.assertIs(
  File "/usr/lib/python3.8/unittest/case.py", line 1193, in assertIs
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: False is not True

======================================================================
FAIL: test_within (gis_tests.gdal_tests.test_geom.OGRGeomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/repo/django/tests/gis_tests/gdal_tests/test_geom.py", line 545, in test_within
    self.assertIs(
  File "/usr/lib/python3.8/unittest/case.py", line 1193, in assertIs
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: False is not True

----------------------------------------------------------------------
Ran 531 tests in 22.801s

FAILED (failures=7, errors=7, skipped=13)

Maybe it's some issue with my local configuration 🤔 .

@claudep
Copy link
Copy Markdown
Member Author

claudep commented Apr 7, 2021

My tests were with GDAL 3.2.1 and GEOS 3.9.1. It may be that GDAL 3.2.2 introduced regressions. I'll see if I can investigate during the next days (but if someone beats me, would be fine :-).

@felixxm
Copy link
Copy Markdown
Member

felixxm commented Apr 7, 2021

GDAL 3.1.4 and GEOS 3.9.1 configuration works for me with this patch. I will try to check GDAL 3.2.0 and 3.2.1 locally.

@felixxm
Copy link
Copy Markdown
Member

felixxm commented Apr 7, 2021

I've checked many combinations and it looks that there is some breaking change or regression in GDAL 3.2.2:

  • GDAL 3.0.4 and GEOS 3.9.1 ✔️
  • GDAL 3.1.4 and GEOS 3.9.1 ✔️
  • GDAL 3.2.0 and GEOS 3.9.1 ✔️
  • GDAL 3.2.1 and GEOS 3.9.1 ✔️
  • GDAL 3.2.2 and GEOS 3.9.1 ❎
  • GDAL 3.1.4 and GEOS 3.8.1 ✔️
  • GDAL 3.2.0 and GEOS 3.8.1 ✔️
  • GDAL 3.2.1 and GEOS 3.8.1 ✔️
  • GDAL 3.2.2 and GEOS 3.8.1 ❎

@claudep
Copy link
Copy Markdown
Member Author

claudep commented Apr 7, 2021

Wow, great investigation! Should we report something to https://github.com/OSGeo/gdal/issues?

@felixxm
Copy link
Copy Markdown
Member

felixxm commented Apr 7, 2021

Wow, great investigation!

I now have dozens of GDAL/GEOS versions 😄

Should we report something to https://github.com/OSGeo/gdal/issues?

I reported an issue, see OSGeo/gdal#3656. Unfortunately without many details 😞

@felixxm
Copy link
Copy Markdown
Member

felixxm commented Apr 7, 2021

I rebuilt GDAL 3.2.2 again and now everything work fine 🤕 Sorry for the noise.

  • GDAL 3.2.2 and GEOS 3.9.1 ✔️
  • GDAL 3.2.2 and GEOS 3.8.1 ✔️

Copy link
Copy Markdown
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also discuss the backport to 3.2, as the only changes are in tests.

That seems reasonable to me if you two are agreed. 👍

Thanks both. 🥇

@felixxm felixxm changed the title Fixed #32544 -- Adapted tests to confirm support for GDAL 3.2/GEOS 3.9. Fixed #32544 -- Confirmed support for GDAL 3.2 and GEOS 3.9. Apr 7, 2021
Copy link
Copy Markdown
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claudep Thanks again 👍 I pushed small edits, and added detection of GDAL 3.2 on Windows with release notes.

@felixxm felixxm merged commit e3cfba0 into django:main Apr 7, 2021
@claudep claudep deleted the geosgdal branch April 7, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants