From 246e516f29b155bb9eec4907f5fad7e1655e1173 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 9 Aug 2016 18:46:14 +0200 Subject: [PATCH] [1.10.x] Unified SpatiaLite spelling Backport of ade681b9ad2a97833cd3f06530fba01e51250b32 from master. --- .../gis/db/backends/spatialite/introspection.py | 2 +- .../contrib/gis/db/backends/spatialite/operations.py | 2 +- django/contrib/gis/db/models/functions.py | 2 +- django/contrib/gis/utils/srs.py | 2 +- docs/ref/contrib/gis/geoquerysets.txt | 4 ++-- docs/ref/contrib/gis/install/geolibs.txt | 10 +++++----- docs/ref/contrib/gis/install/spatialite.txt | 4 ++-- docs/ref/contrib/gis/model-api.txt | 2 +- docs/releases/1.5.2.txt | 2 +- docs/releases/1.8.txt | 4 ++-- tests/gis_tests/distapp/tests.py | 2 +- tests/gis_tests/geoapp/test_functions.py | 4 ++-- tests/gis_tests/inspectapp/tests.py | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/django/contrib/gis/db/backends/spatialite/introspection.py b/django/contrib/gis/db/backends/spatialite/introspection.py index 4222c04f8b..3d0c48bd06 100644 --- a/django/contrib/gis/db/backends/spatialite/introspection.py +++ b/django/contrib/gis/db/backends/spatialite/introspection.py @@ -43,7 +43,7 @@ class SpatiaLiteIntrospection(DatabaseIntrospection): # from OGC geom type name to Django field. ogr_type = row[2] if isinstance(ogr_type, six.integer_types) and ogr_type > 1000: - # Spatialite versions >= 4 use the new SFSQL 1.2 offsets + # SpatiaLite versions >= 4 use the new SFSQL 1.2 offsets # 1000 (Z), 2000 (M), and 3000 (ZM) to indicate the presence of # higher dimensional coordinates (M not yet supported by Django). ogr_type = ogr_type % 1000 + OGRGeomType.wkb25bit diff --git a/django/contrib/gis/db/backends/spatialite/operations.py b/django/contrib/gis/db/backends/spatialite/operations.py index f2f516109a..8064093668 100644 --- a/django/contrib/gis/db/backends/spatialite/operations.py +++ b/django/contrib/gis/db/backends/spatialite/operations.py @@ -122,7 +122,7 @@ class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations): def convert_extent(self, box, srid): """ - Convert the polygon data received from Spatialite to min/max values. + Convert the polygon data received from SpatiaLite to min/max values. """ if box is None: return None diff --git a/django/contrib/gis/db/models/functions.py b/django/contrib/gis/db/models/functions.py index 1a21a5164c..7c17d91809 100644 --- a/django/contrib/gis/db/models/functions.py +++ b/django/contrib/gis/db/models/functions.py @@ -340,7 +340,7 @@ class NumPoints(GeoFunc): def as_sqlite(self, compiler, connection): if self.source_expressions[self.geom_param_pos].output_field.geom_type != 'LINESTRING': - raise TypeError("Spatialite NumPoints can only operate on LineString content") + raise TypeError("SpatiaLite NumPoints can only operate on LineString content") return super(NumPoints, self).as_sql(compiler, connection) diff --git a/django/contrib/gis/utils/srs.py b/django/contrib/gis/utils/srs.py index f1c104fdbb..f9d21ca37a 100644 --- a/django/contrib/gis/utils/srs.py +++ b/django/contrib/gis/utils/srs.py @@ -65,7 +65,7 @@ def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None, if 'srtext' in srs_field_names: kwargs['srtext'] = srs.wkt if 'ref_sys_name' in srs_field_names: - # Spatialite specific + # SpatiaLite specific kwargs['ref_sys_name'] = ref_sys_name or srs.name # Creating the spatial_ref_sys model. diff --git a/docs/ref/contrib/gis/geoquerysets.txt b/docs/ref/contrib/gis/geoquerysets.txt index 1c9d13df85..7d2bcbdd6e 100644 --- a/docs/ref/contrib/gis/geoquerysets.txt +++ b/docs/ref/contrib/gis/geoquerysets.txt @@ -1329,7 +1329,7 @@ Example:: .. class:: Collect(geo_field) -*Availability*: PostGIS, Spatialite +*Availability*: PostGIS, SpatiaLite Returns a ``GEOMETRYCOLLECTION`` or a ``MULTI`` geometry object from the geometry column. This is analogous to a simplified version of the :class:`Union` @@ -1342,7 +1342,7 @@ not caring about dissolving boundaries. .. class:: Extent(geo_field) -*Availability*: PostGIS, Oracle, Spatialite +*Availability*: PostGIS, Oracle, SpatiaLite Returns the extent of all ``geo_field`` in the ``QuerySet`` as a four-tuple, comprising the lower left coordinate and the upper right coordinate. diff --git a/docs/ref/contrib/gis/install/geolibs.txt b/docs/ref/contrib/gis/install/geolibs.txt index e919467bf1..b9d409d004 100644 --- a/docs/ref/contrib/gis/install/geolibs.txt +++ b/docs/ref/contrib/gis/install/geolibs.txt @@ -33,11 +33,11 @@ totally fine with GeoDjango. Your mileage may vary. PostGIS 2.0.0 2012-04-03 PostGIS 2.1.0 2013-08-17 PostGIS 2.2.0 2015-10-17 - Spatialite 3.0.0 2011-12-30 - Spatialite 4.0.0 2012-11-25 - Spatialite 4.1.0 2013-06-04 - Spatialite 4.2.0 2014-07-25 - Spatialite 4.3.0 2015-09-07 + SpatiaLite 3.0.0 2011-12-30 + SpatiaLite 4.0.0 2012-11-25 + SpatiaLite 4.1.0 2013-06-04 + SpatiaLite 4.2.0 2014-07-25 + SpatiaLite 4.3.0 2015-09-07 .. admonition:: Install GDAL diff --git a/docs/ref/contrib/gis/install/spatialite.txt b/docs/ref/contrib/gis/install/spatialite.txt index 13735d6d43..dd1dc5dddb 100644 --- a/docs/ref/contrib/gis/install/spatialite.txt +++ b/docs/ref/contrib/gis/install/spatialite.txt @@ -1,11 +1,11 @@ ===================== -Installing Spatialite +Installing SpatiaLite ===================== `SpatiaLite`__ adds spatial support to SQLite, turning it into a full-featured spatial database. -First, check if you can install Spatialite from system packages or binaries. +First, check if you can install SpatiaLite from system packages or binaries. For example, on Debian-based distributions, try to install the ``spatialite-bin`` package. For distributions that package SpatiaLite 4.2+, diff --git a/docs/ref/contrib/gis/model-api.txt b/docs/ref/contrib/gis/model-api.txt index f795ea7c20..18f8313300 100644 --- a/docs/ref/contrib/gis/model-api.txt +++ b/docs/ref/contrib/gis/model-api.txt @@ -122,7 +122,7 @@ a flat surface is a straight line, the shortest path between two points on a cur surface (such as the earth) is an *arc* of a `great circle`__. [#fnthematic]_ Thus, additional computation is required to obtain distances in planar units (e.g., kilometers and miles). Using a geographic coordinate system may introduce -complications for the developer later on. For example, Spatialite does not have +complications for the developer later on. For example, SpatiaLite does not have the capability to perform distance calculations between geometries using geographic coordinate systems, e.g. constructing a query to find all points within 5 miles of a county boundary stored as WGS84. diff --git a/docs/releases/1.5.2.txt b/docs/releases/1.5.2.txt index 22a415274a..9a53ced78c 100644 --- a/docs/releases/1.5.2.txt +++ b/docs/releases/1.5.2.txt @@ -49,7 +49,7 @@ Bugfixes exceptions recursed infinitely (#20278). * :djadmin:`makemessages` no longer crashes with ``UnicodeDecodeError`` (#20354). -* Fixed ``geojson`` detection with Spatialite. +* Fixed ``geojson`` detection with SpatiaLite. * :meth:`~django.test.SimpleTestCase.assertContains` once again works with binary content (#20237). * Fixed :class:`~django.db.models.ManyToManyField` if it has a unicode ``name`` diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index a9732af208..d0f115db6e 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -225,10 +225,10 @@ Minor features * It is now allowed to include a subquery as a geographic lookup argument, for example ``City.objects.filter(point__within=Country.objects.filter(continent='Africa').values('mpoly'))``. -* The Spatialite backend now supports ``Collect`` and ``Extent`` aggregates +* The SpatiaLite backend now supports ``Collect`` and ``Extent`` aggregates when the database version is 3.0 or later. -* The PostGIS 2 ``CREATE EXTENSION postgis`` and the Spatialite +* The PostGIS 2 ``CREATE EXTENSION postgis`` and the SpatiaLite ``SELECT InitSpatialMetaData`` initialization commands are now automatically run by :djadmin:`migrate`. diff --git a/tests/gis_tests/distapp/tests.py b/tests/gis_tests/distapp/tests.py index ca057da9b8..e00756f911 100644 --- a/tests/gis_tests/distapp/tests.py +++ b/tests/gis_tests/distapp/tests.py @@ -451,7 +451,7 @@ ST_Perimeter(geom1) | OK | :-( (degr ================================ -Distance functions on Spatialite +Distance functions on SpatiaLite ================================ | Projected Geometry | Lon/lat Geometry diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index c0e0a37ab3..1a1727dbbc 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -292,7 +292,7 @@ class GISFunctionsTests(TestCase): qs = Track.objects.annotate(num_points=functions.NumPoints('line')) self.assertEqual(qs.first().num_points, 2) if spatialite or mysql: - # Spatialite and MySQL can only count points on LineStrings + # SpatiaLite and MySQL can only count points on LineStrings return for c in Country.objects.annotate(num_points=functions.NumPoints('mpoly')): @@ -321,7 +321,7 @@ class GISFunctionsTests(TestCase): qs = Country.objects.annotate(point_on_surface=functions.PointOnSurface('mpoly')) for country in qs: - tol = 0.00001 # Spatialite might have WKT-translation-related precision issues + tol = 0.00001 # SpatiaLite might have WKT-translation-related precision issues self.assertTrue(ref[country.name].equals_exact(country.point_on_surface, tol)) @skipUnlessDBFeature("has_Reverse_function") diff --git a/tests/gis_tests/inspectapp/tests.py b/tests/gis_tests/inspectapp/tests.py index 0df9309932..1f43d65bff 100644 --- a/tests/gis_tests/inspectapp/tests.py +++ b/tests/gis_tests/inspectapp/tests.py @@ -189,7 +189,7 @@ def get_ogr_db_string(): except GDALException: return None - # SQLite/Spatialite in-memory databases + # SQLite/SpatiaLite in-memory databases if db['NAME'] == ":memory:": return None