From 5ce660cd65a4ffcf74d94ba987fe03a16b7436a0 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Fri, 10 Jun 2016 11:50:07 +0500 Subject: Fixed #25940 -- Added OGRGeometry.from_gml() and GEOSGeometry.from_gml(). --- tests/gis_tests/gdal_tests/test_geom.py | 10 ++++++++++ tests/gis_tests/geos_tests/test_geos.py | 10 ++++++++++ 2 files changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/gis_tests/gdal_tests/test_geom.py b/tests/gis_tests/gdal_tests/test_geom.py index 163399289a..7ec1b4b990 100644 --- a/tests/gis_tests/gdal_tests/test_geom.py +++ b/tests/gis_tests/gdal_tests/test_geom.py @@ -543,3 +543,13 @@ class OGRGeomTest(unittest.TestCase, TestDataMixin): OGRGeometry('POINT(0.5 0.5)').within(OGRGeometry('POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))')), True ) self.assertIs(OGRGeometry('POINT(0 0)').within(OGRGeometry('POINT(0 1)')), False) + + def test_from_gml(self): + self.assertEqual( + OGRGeometry('POINT(0 0)'), + OGRGeometry.from_gml( + '' + ' 0 0' + '' + ), + ) diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py index 36457f4f51..a7724de9bc 100644 --- a/tests/gis_tests/geos_tests/test_geos.py +++ b/tests/gis_tests/geos_tests/test_geos.py @@ -1300,6 +1300,16 @@ class GEOSTest(SimpleTestCase, TestDataMixin): self.assertEqual(m.group('version'), v_geos) self.assertEqual(m.group('capi_version'), v_capi) + def test_from_gml(self): + self.assertEqual( + GEOSGeometry('POINT(0 0)'), + GEOSGeometry.from_gml( + '' + ' 0 0' + '' + ), + ) + @ignore_warnings(category=RemovedInDjango20Warning) def test_deprecated_srid_getters_setters(self): p = Point(1, 2, srid=123) -- cgit v1.3