1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #32353, Refs #32352 -- Fixed GIS tests with PROJ 7.X.

Different PROJ versions use different transformations, all are correct
as having a 1 meter accuracy.

These are differences in PROJ versions that cannot and should not be
handled in Django itself.

Thanks Jani Tiainen and David Smith for reports.

See: https://github.com/OSGeo/gdal/issues/3377
This commit is contained in:
Mariusz Felisiak
2021-03-23 09:16:33 +01:00
committed by GitHub
parent 71ec102b01
commit 2cd4026334
4 changed files with 17 additions and 8 deletions

View File

@@ -77,10 +77,11 @@ class GeoJSONSerializerTests(TestCase):
def test_srid_option(self):
geojson = serializers.serialize('geojson', City.objects.all().order_by('name'), srid=2847)
geodata = json.loads(geojson)
self.assertEqual(
[int(c) for c in geodata['features'][0]['geometry']['coordinates']],
[1564802, 5613214]
)
coordinates = geodata['features'][0]['geometry']['coordinates']
# Different PROJ versions use different transformations, all are
# correct as having a 1 meter accuracy.
self.assertAlmostEqual(coordinates[0], 1564802, -1)
self.assertAlmostEqual(coordinates[1], 5613214, -1)
def test_deserialization_exception(self):
"""