diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2017-03-30 20:17:13 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-04-01 15:35:30 -0400 |
| commit | 24023c6a8fc768ccb72108d2dd4fd8ece04075fd (patch) | |
| tree | a8b874de21a4a2cedc5a9a732d81ac477c775f09 /tests | |
| parent | ede4f6d48c1fe060c239b2477c00df6bbfd4fd7c (diff) | |
Fixed #25874 -- Made GEOSGeometry read SRID from GeoJSON input.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geos_tests/test_geos.py | 16 |
1 files changed, 15 insertions, 1 deletions
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." |
