diff --git a/django/contrib/gis/db/backends/spatialite/models.py b/django/contrib/gis/db/backends/spatialite/models.py
index 9860779..551bc70 100644
a
|
b
|
|
1 | 1 | """ |
2 | 2 | The GeometryColumns and SpatialRefSys models for the SpatiaLite backend. |
3 | 3 | """ |
4 | | from django.db import models |
| 4 | from django.db import connection, models |
5 | 5 | from django.contrib.gis.db.backends.base import SpatialRefSysMixin |
6 | 6 | from django.utils.encoding import python_2_unicode_compatible |
7 | 7 | |
… |
… |
class SpatialRefSys(models.Model, SpatialRefSysMixin):
|
53 | 53 | auth_srid = models.IntegerField() |
54 | 54 | ref_sys_name = models.CharField(max_length=256) |
55 | 55 | proj4text = models.CharField(max_length=2048) |
| 56 | if connection.ops.spatial_version[0] >= 4: |
| 57 | srtext = models.CharField(max_length=2048) |
56 | 58 | |
57 | 59 | @property |
58 | 60 | def wkt(self): |
| 61 | if hasattr(self, 'srtext'): |
| 62 | return self.srtext |
59 | 63 | from django.contrib.gis.gdal import SpatialReference |
60 | 64 | return SpatialReference(self.proj4text).wkt |
61 | 65 | |
diff --git a/django/contrib/gis/tests/test_spatialrefsys.py b/django/contrib/gis/tests/test_spatialrefsys.py
index 194578d..3744546 100644
a
|
b
|
test_srs = ({'srid': 4326,
|
12 | 12 | # Only the beginning, because there are differences depending on installed libs |
13 | 13 | 'srtext': 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84"', |
14 | 14 | # +ellps=WGS84 has been removed in the 4326 proj string in proj-4.8 |
15 | | 'proj4_re': r'\+proj=longlat (\+ellps=WGS84 )?\+datum=WGS84 \+no_defs ', |
| 15 | 'proj4_re': r'\+proj=longlat (\+ellps=WGS84 )?(\+datum=WGS84 |\+towgs84=0,0,0,0,0,0,0 )\+no_defs ', |
16 | 16 | 'spheroid': 'WGS 84', 'name': 'WGS 84', |
17 | 17 | 'geographic': True, 'projected': False, 'spatialite': True, |
18 | 18 | 'ellipsoid': (6378137.0, 6356752.3, 298.257223563), # From proj's "cs2cs -le" and Wikipedia (semi-minor only) |