From 24023c6a8fc768ccb72108d2dd4fd8ece04075fd Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Thu, 30 Mar 2017 20:17:13 +0500 Subject: Fixed #25874 -- Made GEOSGeometry read SRID from GeoJSON input. --- tests/gis_tests/geos_tests/test_geos.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py index 72d035cc22..3270c75762 100644 --- a/tests/gis_tests/geos_tests/test_geos.py +++ b/tests/gis_tests/geos_tests/test_geos.py @@ -143,7 +143,21 @@ class GEOSTest(SimpleTestCase, TestDataMixin): # Loading jsons to prevent decimal differences self.assertEqual(json.loads(g.json), json.loads(geom.json)) self.assertEqual(json.loads(g.json), json.loads(geom.geojson)) - self.assertEqual(GEOSGeometry(g.wkt), GEOSGeometry(geom.json)) + self.assertEqual(GEOSGeometry(g.wkt, 4326), GEOSGeometry(geom.json)) + + @skipUnless(HAS_GDAL, "GDAL is required.") + def test_json_srid(self): + geojson_data = { + "type": "Point", + "coordinates": [2, 49], + "crs": { + "type": "name", + "properties": { + "name": "urn:ogc:def:crs:EPSG::4322" + } + } + } + self.assertEqual(GEOSGeometry(json.dumps(geojson_data)), Point(2, 49, srid=4322)) def test_fromfile(self): "Testing the fromfile() factory." -- cgit v1.3