Permalink
Browse files

Confirmed Spatialite 4 support

  • Loading branch information...
claudep committed Mar 27, 2014
1 parent 0f1f12c commit e62dea9ad5a4695cbcdec3c7e51b5914d0b2485d
Showing with 12 additions and 11 deletions.
  1. +9 −10 django/contrib/gis/tests/geoapp/tests.py
  2. +3 −1 docs/ref/contrib/gis/install/geolibs.txt
@@ -435,8 +435,11 @@ def test_diff_intersection_union(self):
self.assertEqual(c.mpoly.difference(geom), c.difference) self.assertEqual(c.mpoly.difference(geom), c.difference)
if not spatialite: if not spatialite:
self.assertEqual(c.mpoly.intersection(geom), c.intersection) self.assertEqual(c.mpoly.intersection(geom), c.intersection)
self.assertEqual(c.mpoly.sym_difference(geom), c.sym_difference) # Ordering might differ in collections
self.assertEqual(c.mpoly.union(geom), c.union) self.assertSetEqual(set(g.wkt for g in c.mpoly.sym_difference(geom)),
set(g.wkt for g in c.sym_difference))
self.assertSetEqual(set(g.wkt for g in c.mpoly.union(geom)),
set(g.wkt for g in c.union))
@skipUnless(getattr(connection.ops, 'envelope', False), 'Database does not support envelope operation') @skipUnless(getattr(connection.ops, 'envelope', False), 'Database does not support envelope operation')
def test_envelope(self): def test_envelope(self):
@@ -775,9 +778,9 @@ def test_translate(self):
def test_unionagg(self): def test_unionagg(self):
"Testing the `unionagg` (aggregate union) GeoQuerySet method." "Testing the `unionagg` (aggregate union) GeoQuerySet method."
tx = Country.objects.get(name='Texas').mpoly tx = Country.objects.get(name='Texas').mpoly
# Houston, Dallas -- Oracle has different order. # Houston, Dallas -- Ordering may differ depending on backend or GEOS version.
union1 = fromstr('MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)') union1 = fromstr('MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)')
union2 = fromstr('MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)') union2 = fromstr('MULTIPOINT(-95.363151 29.763374,-96.801611 32.782057)')
qs = City.objects.filter(point__within=tx) qs = City.objects.filter(point__within=tx)
self.assertRaises(TypeError, qs.unionagg, 'name') self.assertRaises(TypeError, qs.unionagg, 'name')
# Using `field_name` keyword argument in one query and specifying an # Using `field_name` keyword argument in one query and specifying an
@@ -786,12 +789,8 @@ def test_unionagg(self):
u1 = qs.unionagg(field_name='point') u1 = qs.unionagg(field_name='point')
u2 = qs.order_by('name').unionagg() u2 = qs.order_by('name').unionagg()
tol = 0.00001 tol = 0.00001
if oracle: self.assertEqual(True, union1.equals_exact(u1, tol) or union2.equals_exact(u1, tol))
union = union2 self.assertEqual(True, union1.equals_exact(u2, tol) or union2.equals_exact(u2, tol))
else:
union = union1
self.assertEqual(True, union.equals_exact(u1, tol))
self.assertEqual(True, union.equals_exact(u2, tol))
qs = City.objects.filter(name='NotACity') qs = City.objects.filter(name='NotACity')
self.assertEqual(None, qs.unionagg(field_name='point')) self.assertEqual(None, qs.unionagg(field_name='point'))
@@ -15,7 +15,7 @@ Program Description Required
: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
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.0, 1.5, 1.4, 1.3 `PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.0, 1.5, 1.4, 1.3
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 3.0, 2.4, 2.3 `SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.1, 4.0, 3.0, 2.4, 2.3
======================== ==================================== ================================ ========================== ======================== ==================================== ================================ ==========================
.. ..
@@ -35,6 +35,8 @@ Program Description Required
SpatiaLite 2.3.0 2009-04-06 SpatiaLite 2.3.0 2009-04-06
Spatialite 2.4.0 2010-11-14 Spatialite 2.4.0 2010-11-14
Spatialite 3.0.0 2011-12-30 Spatialite 3.0.0 2011-12-30
Spatialite 4.0.0 2012-11-25
Spatialite 4.1.0 2013-06-04
.. admonition:: Install GDAL .. admonition:: Install GDAL

0 comments on commit e62dea9

Please sign in to comment.