diff --git a/django/contrib/gis/db/backends/spatialite/models.py b/django/contrib/gis/db/backends/spatialite/models.py
index b281f0b..713561d 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):
|
51 | 51 | auth_srid = models.IntegerField() |
52 | 52 | ref_sys_name = models.CharField(max_length=256) |
53 | 53 | proj4text = models.CharField(max_length=2048) |
| 54 | if connection.ops.spatial_version[0] >= 3: |
| 55 | srtext = models.CharField(max_length=2048) |
54 | 56 | |
55 | 57 | @property |
56 | 58 | def wkt(self): |
| 59 | if hasattr(self, 'srtext'): |
| 60 | return self.srtext |
57 | 61 | from django.contrib.gis.gdal import SpatialReference |
58 | 62 | return SpatialReference(self.proj4text).wkt |
59 | 63 | |
diff --git a/django/contrib/gis/tests/test_spatialrefsys.py b/django/contrib/gis/tests/test_spatialrefsys.py
index 5bb6a70..498d072 100644
a
|
b
|
test_srs = ({'srid' : 4326,
|
24 | 24 | 'srtext' : 'PROJCS["NAD83 / Texas South Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980"', |
25 | 25 | 'proj4_re' : r'\+proj=lcc \+lat_1=30.28333333333333 \+lat_2=28.38333333333333 \+lat_0=27.83333333333333 ' |
26 | 26 | r'\+lon_0=-99 \+x_0=600000 \+y_0=4000000 (\+ellps=GRS80 )?' |
27 | | r'(\+datum=NAD83 |\+towgs84=0,0,0,0,0,0,0)?\+units=m \+no_defs ', |
| 27 | r'(\+datum=NAD83 |\+towgs84=0,0,0,0,0,0,0 )?\+units=m \+no_defs ', |
28 | 28 | 'spheroid' : 'GRS 1980', 'name' : 'NAD83 / Texas South Central', |
29 | 29 | 'geographic' : False, 'projected' : True, 'spatialite' : False, |
30 | 30 | 'ellipsoid' : (6378137.0, 6356752.31414, 298.257222101), # From proj's "cs2cs -le" and Wikipedia (semi-minor only) |