From 0f1f12c5641acfbbf1fe58b0e6dd6f755fbbe61e Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 27 Mar 2014 21:17:10 +0100 Subject: [PATCH] Confirmed GEOS 3.4 support --- django/contrib/gis/tests/geo3d/tests.py | 3 ++- django/contrib/gis/tests/relatedapp/tests.py | 23 +++++++++----------- docs/ref/contrib/gis/install/geolibs.txt | 3 ++- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/django/contrib/gis/tests/geo3d/tests.py b/django/contrib/gis/tests/geo3d/tests.py index 917085013d..2c7f93859a 100644 --- a/django/contrib/gis/tests/geo3d/tests.py +++ b/django/contrib/gis/tests/geo3d/tests.py @@ -188,7 +188,8 @@ class Geo3DTest(TestCase): ref_union = GEOSGeometry(ref_ewkt) union = City3D.objects.aggregate(Union('point'))['point__union'] self.assertTrue(union.hasz) - self.assertEqual(ref_union, union) + # Ordering of points in the resulting geometry may vary between implementations + self.assertSetEqual(set([p.ewkt for p in ref_union]), set([p.ewkt for p in union])) def test_extent(self): """ diff --git a/django/contrib/gis/tests/relatedapp/tests.py b/django/contrib/gis/tests/relatedapp/tests.py index b478005c40..85bde167f5 100644 --- a/django/contrib/gis/tests/relatedapp/tests.py +++ b/django/contrib/gis/tests/relatedapp/tests.py @@ -96,26 +96,23 @@ class RelatedGeoModelTest(TestCase): p4 = Point(-96.801611, 32.782057) p5 = Point(-95.363151, 29.763374) - # Creating the reference union geometry depending on the spatial backend, - # as Oracle will have a different internal ordering of the component - # geometries than PostGIS. The second union aggregate is for a union + # The second union aggregate is for a union # query that includes limiting information in the WHERE clause (in other # words a `.filter()` precedes the call to `.unionagg()`). - if oracle: - ref_u1 = MultiPoint(p4, p5, p3, p1, p2, srid=4326) - ref_u2 = MultiPoint(p3, p2, srid=4326) - else: - # Looks like PostGIS points by longitude value. - ref_u1 = MultiPoint(p1, p2, p4, p5, p3, srid=4326) - ref_u2 = MultiPoint(p2, p3, srid=4326) + ref_u1 = MultiPoint(p1, p2, p4, p5, p3, srid=4326) + ref_u2 = MultiPoint(p2, p3, srid=4326) u1 = City.objects.unionagg(field_name='location__point') u2 = City.objects.exclude(name__in=('Roswell', 'Houston', 'Dallas', 'Fort Worth')).unionagg(field_name='location__point') u3 = aggs['location__point__union'] + self.assertEqual(type(u1), MultiPoint) + self.assertEqual(type(u3), MultiPoint) - self.assertEqual(ref_u1, u1) - self.assertEqual(ref_u2, u2) - self.assertEqual(ref_u1, u3) + # Ordering of points in the result of the union is not defined and + # implementation-dependent (DB backend, GEOS version) + self.assertSetEqual(set([p.ewkt for p in ref_u1]), set([p.ewkt for p in u1])) + self.assertSetEqual(set([p.ewkt for p in ref_u2]), set([p.ewkt for p in u2])) + self.assertSetEqual(set([p.ewkt for p in ref_u1]), set([p.ewkt for p in u3])) def test05_select_related_fk_to_subclass(self): "Testing that calling select_related on a query over a model with an FK to a model subclass works" diff --git a/docs/ref/contrib/gis/install/geolibs.txt b/docs/ref/contrib/gis/install/geolibs.txt index a529a497d2..5e68f52fe6 100644 --- a/docs/ref/contrib/gis/install/geolibs.txt +++ b/docs/ref/contrib/gis/install/geolibs.txt @@ -10,7 +10,7 @@ geospatial libraries: ======================== ==================================== ================================ ========================== Program Description Required Supported Versions ======================== ==================================== ================================ ========================== -:ref:`GEOS ` Geometry Engine Open Source Yes 3.3, 3.2, 3.1 +:ref:`GEOS ` Geometry Engine Open Source Yes 3.4, 3.3, 3.2, 3.1 `PROJ.4`_ Cartographic Projections library Yes (PostgreSQL and SQLite only) 4.8, 4.7, 4.6, 4.5, 4.4 :ref:`GDAL ` Geospatial Data Abstraction Library No (but, required for SQLite) 1.9, 1.8, 1.7, 1.6 :ref:`GeoIP ` IP-based geolocation library No 1.4 @@ -23,6 +23,7 @@ Program Description Required GEOS 3.1.0 2009-03-11 GEOS 3.2.0 2009-12-14 GEOS 3.3.0 2011-05-30 + GEOS 3.4.0 2013-08-11 GDAL 1.6.0 2008-12-04 GDAL 1.7.1 2010-02-08 GDAL 1.8.0 2011-01-13