Ticket #12312: 12312_ogrgeometry_transform_wkt_3d_v2.diff
File 12312_ogrgeometry_transform_wkt_3d_v2.diff, 1.4 KB (added by , 15 years ago) |
---|
-
django/contrib/gis/tests/geo3d/tests.py
2 2 from django.contrib.gis.db.models import Union, Extent3D 3 3 from django.contrib.gis.geos import GEOSGeometry, Point, Polygon 4 4 from django.contrib.gis.utils import LayerMapping, LayerMapError 5 from django.contrib.gis.gdal import OGRGeometry 5 6 6 7 from models import City3D, Interstate2D, Interstate3D, \ 7 8 InterstateProj2D, InterstateProj3D, \ … … 228 229 for city in City3D.objects.translate(0, 0, ztrans): 229 230 self.assertEqual(city_dict[city.name][2] + ztrans, city.translate.z) 230 231 232 def test08_ogrgeometry_transform_wkt(self): 233 "Testing dimensions on WKT output of geometries transformed with OGRGeometry.transform" 234 wkt_2d = "MULTILINESTRING ((0 0,1 1,2 2))" 235 wkt_3d = "MULTILINESTRING ((0 0 0,1 1 1,2 2 2))" 236 srid = 4326 237 238 geom = OGRGeometry(wkt_2d, srid) 239 geom.transform(srid) 240 self.assertEqual(geom.coord_dim, 2) 241 self.assertEqual(geom.wkt, wkt_2d) 242 243 geom = OGRGeometry(wkt_3d, srid) 244 geom.transform(srid) 245 self.assertEaual(geom.coord_dim, 3) 246 self.assertEaual(geom.wkt, wkt_3d) 247 248 249 231 250 def suite(): 232 251 s = unittest.TestSuite() 233 252 s.addTest(unittest.makeSuite(Geo3DTest))