Confirmed GEOS 3.4 support

This commit is contained in:
Claude Paroz 2014-03-27 21:17:10 +01:00
parent 21f208e66e
commit 0f1f12c564
3 changed files with 14 additions and 15 deletions

View File

@ -188,7 +188,8 @@ class Geo3DTest(TestCase):
ref_union = GEOSGeometry(ref_ewkt) ref_union = GEOSGeometry(ref_ewkt)
union = City3D.objects.aggregate(Union('point'))['point__union'] union = City3D.objects.aggregate(Union('point'))['point__union']
self.assertTrue(union.hasz) 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): def test_extent(self):
""" """

View File

@ -96,26 +96,23 @@ class RelatedGeoModelTest(TestCase):
p4 = Point(-96.801611, 32.782057) p4 = Point(-96.801611, 32.782057)
p5 = Point(-95.363151, 29.763374) p5 = Point(-95.363151, 29.763374)
# Creating the reference union geometry depending on the spatial backend, # The second union aggregate is for a union
# as Oracle will have a different internal ordering of the component
# geometries than PostGIS. The second union aggregate is for a union
# query that includes limiting information in the WHERE clause (in other # query that includes limiting information in the WHERE clause (in other
# words a `.filter()` precedes the call to `.unionagg()`). # words a `.filter()` precedes the call to `.unionagg()`).
if oracle: ref_u1 = MultiPoint(p1, p2, p4, p5, p3, srid=4326)
ref_u1 = MultiPoint(p4, p5, p3, p1, p2, srid=4326) ref_u2 = MultiPoint(p2, p3, 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)
u1 = City.objects.unionagg(field_name='location__point') u1 = City.objects.unionagg(field_name='location__point')
u2 = City.objects.exclude(name__in=('Roswell', 'Houston', 'Dallas', 'Fort Worth')).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'] u3 = aggs['location__point__union']
self.assertEqual(type(u1), MultiPoint)
self.assertEqual(type(u3), MultiPoint)
self.assertEqual(ref_u1, u1) # Ordering of points in the result of the union is not defined and
self.assertEqual(ref_u2, u2) # implementation-dependent (DB backend, GEOS version)
self.assertEqual(ref_u1, u3) 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): 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" "Testing that calling select_related on a query over a model with an FK to a model subclass works"

View File

@ -10,7 +10,7 @@ geospatial libraries:
======================== ==================================== ================================ ========================== ======================== ==================================== ================================ ==========================
Program Description Required Supported Versions 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 `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:`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 :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.1.0 2009-03-11
GEOS 3.2.0 2009-12-14 GEOS 3.2.0 2009-12-14
GEOS 3.3.0 2011-05-30 GEOS 3.3.0 2011-05-30
GEOS 3.4.0 2013-08-11
GDAL 1.6.0 2008-12-04 GDAL 1.6.0 2008-12-04
GDAL 1.7.1 2010-02-08 GDAL 1.7.1 2010-02-08
GDAL 1.8.0 2011-01-13 GDAL 1.8.0 2011-01-13