From 4577ca4e552d52d6b12415bf82b47a2c28481abf Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 16 Sep 2021 13:42:58 +0200 Subject: [PATCH] Merge pull request #4496 from rouault/autotest_update_for_epsg_10_035 autotest: make it robust to EPSG 10.035 update --- autotest/ogr/ogr_mitab.py | 29 ++++++++++++++--------------- autotest/osr/osr_epsg.py | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/autotest/ogr/ogr_mitab.py b/autotest/ogr/ogr_mitab.py index bc1b82201fa6..795bd2d91794 100755 --- a/autotest/ogr/ogr_mitab.py +++ b/autotest/ogr/ogr_mitab.py @@ -540,7 +540,7 @@ def test_ogr_mitab_19(): feat.DumpReadable() pytest.fail() - + ############################################################################### # Check that we take into account the user defined bound file @@ -778,7 +778,7 @@ def test_ogr_mitab_23(): ogr.GetDriverByName('MapInfo File').DeleteDataSource(filename) - + ############################################################################### # Test creating features then reading then creating again then reading @@ -821,7 +821,7 @@ def test_ogr_mitab_24(): ogr.GetDriverByName('MapInfo File').DeleteDataSource(filename) - + ############################################################################### # Test that opening in update mode without doing any change does not alter # file @@ -885,7 +885,7 @@ def test_ogr_mitab_25(): ogr.GetDriverByName('MapInfo File').DeleteDataSource(filename) - + ############################################################################### # Test DeleteFeature() @@ -954,7 +954,7 @@ def test_ogr_mitab_26(): ogr.GetDriverByName('MapInfo File').DeleteDataSource(filename) - + ############################################################################### # Test SetFeature() @@ -1598,8 +1598,7 @@ def test_ogr_mitab_35(): coordsys = get_coordsys_from_srs(srs) assert coordsys == 'CoordSys Earth Projection 3, 33, "m", 3, 46.5, 44, 49, 700000, 6600000' srs = get_srs_from_coordsys(coordsys) - wkt = srs.ExportToWkt() - assert wkt == 'PROJCS["RGF93 / Lambert-93",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 80",6378137,298.257222101],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","2154"]]' + assert srs.GetAuthorityCode(None) == '2154' coordsys = get_coordsys_from_srs(srs) assert coordsys == 'CoordSys Earth Projection 3, 33, "m", 3, 46.5, 44, 49, 700000, 6600000' @@ -1738,7 +1737,7 @@ def test_ogr_mitab_38(): f.DumpReadable() pytest.fail() - + ############################################################################### # Read various geometry types from .mif @@ -1762,7 +1761,7 @@ def test_ogr_mitab_39(): f_ref.DumpReadable() pytest.fail() - + ############################################################################### # Read various geometry types from .mif but potentially truncated @@ -1805,7 +1804,7 @@ def test_ogr_mitab_41(): f_ref.DumpReadable() pytest.fail() - + ############################################################################### # Read various geometry types from .tab with block size = 32256 @@ -1829,7 +1828,7 @@ def test_ogr_mitab_42(): f_ref.DumpReadable() pytest.fail() - + ############################################################################### # Test creating tab with block size = 32256 @@ -1982,7 +1981,7 @@ def test_ogr_mitab_45(): gdaltest.mapinfo_drv.DeleteDataSource(dsName) - + ############################################################################### # Test read MapInfo layers with encoding specified @@ -2031,7 +2030,7 @@ def test_ogr_mitab_46(): ' expected value: "' + expectedValue + '"\n' ' from dataset :' + dsName) - + ############################################################################### # Test opening a dataset with a .ind file @@ -2054,7 +2053,7 @@ def test_ogr_mitab_47(): for ext in ('tab', 'dat', 'map', 'id'): gdal.Unlink('/vsimem/poly_indexed.' + ext) - + ############################################################################### # Test writing and reading LCC_1SP @@ -2378,7 +2377,7 @@ def test_ogr_mitab_description(): assert lyr is not None, ('Can\'t create layer "test_description"') if lyr.TestCapability(ogr.OLCStringsAsUTF8) != 1: pytest.skip('skipping test: recode is not possible') - + lyr.CreateField(ogr.FieldDefn('feature_id', ogr.OFTInteger)) lyr.CreateField(ogr.FieldDefn('other_field', ogr.OFTInteger)) diff --git a/autotest/osr/osr_epsg.py b/autotest/osr/osr_epsg.py index d74b58ff0dec..14f8e13e66d5 100755 --- a/autotest/osr/osr_epsg.py +++ b/autotest/osr/osr_epsg.py @@ -397,7 +397,7 @@ def test_osr_GetCRSInfoListFromDatabase(): found = False for record in l: if record.auth_name == 'EPSG' and record.code == '2154': - assert record.name == 'RGF93 / Lambert-93' + assert 'Lambert-93' in record.name assert record.type == osr.OSR_CRS_TYPE_PROJECTED assert not record.deprecated assert record.bbox_valid