summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2016-06-10 11:50:07 +0500
committerTim Graham <timograham@gmail.com>2016-06-21 15:46:27 -0400
commit5ce660cd65a4ffcf74d94ba987fe03a16b7436a0 (patch)
tree5604cabb82104ac37dfec47da76cddb240156ef1 /tests
parent20d1cb33c2ec1242e16c49deb88e8c70517b2d1a (diff)
Fixed #25940 -- Added OGRGeometry.from_gml() and GEOSGeometry.from_gml().
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/gdal_tests/test_geom.py10
-rw-r--r--tests/gis_tests/geos_tests/test_geos.py10
2 files changed, 20 insertions, 0 deletions
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(
+ '<gml:Point gml:id="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326">'
+ ' <gml:pos srsDimension="2">0 0</gml:pos>'
+ '</gml:Point>'
+ ),
+ )
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(
+ '<gml:Point gml:id="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326">'
+ ' <gml:pos srsDimension="2">0 0</gml:pos>'
+ '</gml:Point>'
+ ),
+ )
+
@ignore_warnings(category=RemovedInDjango20Warning)
def test_deprecated_srid_getters_setters(self):
p = Point(1, 2, srid=123)