summaryrefslogtreecommitdiff
path: root/tests/gis_tests
diff options
context:
space:
mode:
authorStefan Brand <stefan.brand@eox.at>2023-02-17 09:44:17 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-02-17 19:56:29 +0100
commiteacf6b73d8eace004f840bd9b80c8c671caab9da (patch)
treea3223dbfa8284071c3e601d3638d6050087393a6 /tests/gis_tests
parentd77762de038d1ab46cdcda2b7202d36c80956e25 (diff)
downloaddjango-eacf6b73d8eace004f840bd9b80c8c671caab9da.tar.gz
Fixed #34302 -- Fixed SpatialReference.srid for objects without top-level authority.
Diffstat (limited to 'tests/gis_tests')
-rw-r--r--tests/gis_tests/gdal_tests/test_srs.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/gis_tests/gdal_tests/test_srs.py b/tests/gis_tests/gdal_tests/test_srs.py
index 293144aa8e..9bfe5680da 100644
--- a/tests/gis_tests/gdal_tests/test_srs.py
+++ b/tests/gis_tests/gdal_tests/test_srs.py
@@ -102,7 +102,10 @@ srlist = (
ang_name="Degree",
lin_units=0.3048006096012192,
ang_units=0.0174532925199,
- auth={"PROJCS": (None, None)},
+ auth={
+ None: (None, None), # Top-level authority.
+ "PROJCS": (None, None),
+ },
attr=(
("PROJCS|GeOgCs|spheroid", "GRS 1980"),
(("projcs", 9), "UNIT"),
@@ -391,3 +394,10 @@ class SpatialRefTest(SimpleTestCase):
self.assertIn('DATUM["D_North_American_1983"', srs.wkt)
srs.from_esri()
self.assertIn('DATUM["North_American_Datum_1983"', srs.wkt)
+
+ def test_srid(self):
+ """The srid property returns top-level authority code."""
+ for s in srlist:
+ if hasattr(s, "epsg"):
+ srs = SpatialReference(s.wkt)
+ self.assertEqual(srs.srid, s.epsg)