Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Confirmed GEOS 3.4 support

  • Loading branch information...
commit 0f1f12c5641acfbbf1fe58b0e6dd6f755fbbe61e 1 parent 21f208e
Claude Paroz claudep authored
3  django/contrib/gis/tests/geo3d/tests.py
View
@@ -188,7 +188,8 @@ def test_union(self):
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):
"""
25 django/contrib/gis/tests/relatedapp/tests.py
View
@@ -96,26 +96,23 @@ def test04b_related_union_aggregate(self):
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(ref_u1, u1)
- self.assertEqual(ref_u2, u2)
- self.assertEqual(ref_u1, u3)
+ self.assertEqual(type(u1), MultiPoint)
+ self.assertEqual(type(u3), MultiPoint)
+
+ # 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"
3  docs/ref/contrib/gis/install/geolibs.txt
View
@@ -10,7 +10,7 @@ geospatial libraries:
======================== ==================================== ================================ ==========================
Program Description Required Supported Versions
======================== ==================================== ================================ ==========================
-:ref:`GEOS <ref-geos>` Geometry Engine Open Source Yes 3.3, 3.2, 3.1
+:ref:`GEOS <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 <ref-gdal>` Geospatial Data Abstraction Library No (but, required for SQLite) 1.9, 1.8, 1.7, 1.6
:ref:`GeoIP <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
Please sign in to comment.
Something went wrong with that request. Please try again.