本文整理汇总了Python中test_cli_utilities.get_gdalsrsinfo_path函数的典型用法代码示例。如果您正苦于以下问题:Python get_gdalsrsinfo_path函数的具体用法?Python get_gdalsrsinfo_path怎么用?Python get_gdalsrsinfo_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_gdalsrsinfo_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_gdalsrsinfo_17
def test_gdalsrsinfo_17():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return 'skip'
# Zero match
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() +
' -e "LOCAL_CS[foo]"')
if ret.find('EPSG:-1') < 0:
gdaltest.post_reason('fail')
print(ret)
return 'fail'
# One match
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() +
' -e ../osr/data/lcc_esri.prj')
if ret.find('EPSG:32119') < 0:
gdaltest.post_reason('fail')
print(ret)
return 'fail'
# Two matches
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() +
""" -e "GEOGCS[\"myLKS94\",DATUM[\"Lithuania_1994_ETRS89\",SPHEROID[\"GRS_1980\",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" """)
if ret.find('EPSG:4126') < 0 or ret.find('EPSG:4669') < 0:
gdaltest.post_reason('fail')
print(ret)
return 'fail'
return 'success'
示例2: test_gdalsrsinfo_5
def test_gdalsrsinfo_5():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
pytest.skip()
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() +
' --single-line -o wkt_noct ../gcore/data/byte.tif')
assert ret.strip() == 'PROJCS["NAD27 / UTM zone 11N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213898]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]'
示例3: test_gdalsrsinfo_12
def test_gdalsrsinfo_12():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
pytest.skip()
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() +
' --single-line -o wkt1 EPSG:4326')
assert ret.strip() == """GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]"""
示例4: test_gdalsrsinfo_9
def test_gdalsrsinfo_9():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return "skip"
(ret, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_gdalsrsinfo_path() + " inexistent_file")
if err.strip() != "ERROR 1: ERROR - failed to load SRS definition from inexistent_file":
return "fail"
return "success"
示例5: test_gdalsrsinfo_2
def test_gdalsrsinfo_2():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return "skip"
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() + " -o proj4 ../gcore/data/byte.tif")
if ret.strip() != "'+proj=utm +zone=11 +datum=NAD27 +units=m +no_defs '":
return "fail"
return "success"
示例6: test_gdalsrsinfo_7
def test_gdalsrsinfo_7():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return "skip"
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() + " -o mapinfo ../gcore/data/byte.tif")
if ret.strip() != """'Earth Projection 8, 62, "m", -117, 0, 0.9996, 500000, 0'""":
return "fail"
return "success"
示例7: test_gdalsrsinfo_15
def test_gdalsrsinfo_15():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() + \
' -o proj4 ../osr/data/lcc_esri.prj')
if ret.strip() != "'+proj=lcc +lat_1=34.33333333333334 +lat_2=36.16666666666666 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +datum=NAD83 +units=m +no_defs '":
return 'fail'
return 'success'
示例8: test_gdalsrsinfo_14bis
def test_gdalsrsinfo_14bis():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() + \
' -o proj4 ../ogr/data/Stacks.shp')
if ret.strip() != "'+proj=lcc +lat_1=28.38333333333333 +lat_2=30.28333333333334 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000.0000000001 +y_0=4000000 +datum=NAD83 +units=us-ft +no_defs '":
return 'fail'
return 'success'
示例9: test_gdalsrsinfo_9
def test_gdalsrsinfo_9():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return 'skip'
ret, err = gdaltest.runexternal_out_and_err(
test_cli_utilities.get_gdalsrsinfo_path() + ' nonexistent_file')
if err.strip() != "ERROR 1: ERROR - failed to load SRS definition from nonexistent_file":
return 'fail'
return 'success'
示例10: test_gdalsrsinfo_14
def test_gdalsrsinfo_14():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() + \
' -o proj4 /vsizip/../gcore/data/byte.tif.zip')
if ret.strip() != "'+proj=utm +zone=11 +datum=NAD27 +units=m +no_defs '":
return 'fail'
return 'success'
示例11: test_gdalsrsinfo_12
def test_gdalsrsinfo_12():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() + \
' -o wkt EPSG:4326')
if ret.strip() != """GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]""":
return 'fail'
return 'success'
示例12: test_gdalsrsinfo_1
def test_gdalsrsinfo_1():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() + ' ../gcore/data/byte.tif')
if ret.find('PROJ.4 :') == -1:
return 'fail'
if ret.find('OGC WKT :') == -1:
return 'fail'
return 'success'
示例13: test_gdalsrsinfo_2
def test_gdalsrsinfo_2():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() +
' -o proj4 ../gcore/data/byte.tif')
if ret.strip() != "+proj=utm +zone=11 +datum=NAD27 +units=m +no_defs":
print(ret.strip())
return 'fail'
return 'success'
示例14: test_gdalsrsinfo_5
def test_gdalsrsinfo_5():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
return "skip"
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() + " -o wkt_noct ../gcore/data/byte.tif")
first_val = 'PROJCS["NAD27 / UTM zone 11N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.9786982139006]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]'
second_val = 'PROJCS["NAD27 / UTM zone 11N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.9786982138982]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1]]'
if ret.strip() != first_val and ret.strip() != second_val:
print(ret.strip())
return "fail"
return "success"
示例15: test_gdalsrsinfo_all
def test_gdalsrsinfo_all():
if test_cli_utilities.get_gdalsrsinfo_path() is None:
pytest.skip()
ret = gdaltest.runexternal(test_cli_utilities.get_gdalsrsinfo_path() +
' -o all ../gcore/data/byte.tif', encoding = 'UTF-8')
assert 'PROJ.4 :' in ret, ret
assert 'OGC WKT1 :' in ret, ret
assert 'OGC WKT2:2015 :' in ret, ret
assert 'OGC WKT2:2018 :' in ret, ret
assert 'OGC WKT1 (simple) :' in ret, ret
assert 'OGC WKT1 (no CT) :' in ret, ret
assert 'ESRI WKT :' in ret, ret