本文整理汇总了Python中test_cli_utilities.get_ogrinfo_path函数的典型用法代码示例。如果您正苦于以下问题:Python get_ogrinfo_path函数的具体用法?Python get_ogrinfo_path怎么用?Python get_ogrinfo_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_ogrinfo_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ogr2ogr_py_6
def test_ogr2ogr_py_6():
import ogr_pg
script_path = test_py_scripts.get_py_script('ogr2ogr')
if script_path is None:
pytest.skip()
if test_cli_utilities.get_ogrinfo_path() is None:
pytest.skip()
ogr_pg.test_ogr_pg_1()
if gdaltest.pg_ds is None:
pytest.skip()
gdaltest.pg_ds.Destroy()
gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' PG:"' + gdaltest.pg_connection_string + '" -sql "DELLAYER:tpoly"')
test_py_scripts.run_py_script(script_path, 'ogr2ogr', '-f PostgreSQL PG:"' + gdaltest.pg_connection_string + '" ../ogr/data/poly.shp -nln tpoly')
test_py_scripts.run_py_script(script_path, 'ogr2ogr', '-update -overwrite -f PostgreSQL PG:"' + gdaltest.pg_connection_string + '" ../ogr/data/poly.shp -nln tpoly')
ds = ogr.Open('PG:' + gdaltest.pg_connection_string)
assert ds is not None and ds.GetLayerByName('tpoly').GetFeatureCount() == 10
ds.Destroy()
gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' PG:"' + gdaltest.pg_connection_string + '" -sql "DELLAYER:tpoly"')
示例2: test_ogrinfo_3
def test_ogrinfo_3():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' -al ../ogr/data/poly.shp')
if ret.find('Layer name: poly') == -1:
gdaltest.post_reason('fail')
return 'fail'
if ret.find('Geometry: Polygon') == -1:
gdaltest.post_reason('fail')
return 'fail'
if ret.find('Feature Count: 10') == -1:
gdaltest.post_reason('fail')
return 'fail'
if ret.find('Extent: (478315') == -1:
gdaltest.post_reason('fail')
return 'fail'
if ret.find('PROJCS["OSGB') == -1:
gdaltest.post_reason('fail')
return 'fail'
if ret.find('AREA: Real (') == -1:
gdaltest.post_reason('fail')
return 'fail'
return 'success'
示例3: test_ogrinfo_11
def test_ogrinfo_11():
if test_cli_utilities.get_ogrinfo_path() is None:
pytest.skip()
ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' ../ogr/data/poly.shp poly -fields=no')
assert ret.find('AREA (Real') == -1
assert ret.find('POLYGON (') != -1
示例4: test_ogrinfo_17
def test_ogrinfo_17():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
(out, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' --optfile', check_memleak = False )
if err.find('--optfile option given without filename') < 0:
gdaltest.post_reason('fail')
print(err)
return 'fail'
(out, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' --optfile /foo/bar', check_memleak = False )
if err.find('Unable to open optfile') < 0:
gdaltest.post_reason('fail')
print(err)
return 'fail'
f = open('tmp/optfile.txt', 'wt')
f.write('--config foo\n')
f.close()
(out, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' --optfile tmp/optfile.txt', check_memleak = False )
os.unlink('tmp/optfile.txt')
if err.find('--config option given without a key and value argument') < 0:
gdaltest.post_reason('fail')
print(err)
return 'fail'
return 'success'
示例5: test_ogrinfo_6
def test_ogrinfo_6():
if test_cli_utilities.get_ogrinfo_path() is None:
pytest.skip()
ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' ../ogr/data/poly.shp poly -geom=no')
assert ret.find('Feature Count: 10') != -1
assert ret.find('POLYGON') == -1
示例6: test_ogrinfo_1
def test_ogrinfo_1():
if test_cli_utilities.get_ogrinfo_path() is None:
pytest.skip()
(ret, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' ../ogr/data/poly.shp')
assert (err is None or err == ''), 'got error/warning'
assert ret.find('ESRI Shapefile') != -1
示例7: test_ogrinfo_25
def test_ogrinfo_25():
if test_cli_utilities.get_ogrinfo_path() is None:
pytest.skip()
(ret, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' -rl -q ../ogr/data/poly.shp')
assert (err is None or err == ''), 'got error/warning'
assert 'OGRFeature(poly):0' in ret and 'OGRFeature(poly):9' in ret, \
'wrong output'
示例8: test_ogrinfo_5
def test_ogrinfo_5():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' ../ogr/data/poly.shp -sql "select * from poly"')
if ret.find('Feature Count: 10') == -1:
return 'fail'
return 'success'
示例9: test_ogrinfo_9
def test_ogrinfo_9():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' ../ogr/data/poly.shp poly -where "EAS_ID=171"')
if ret.find('Feature Count: 1') == -1:
return 'fail'
return 'success'
示例10: test_ogrinfo_2
def test_ogrinfo_2():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' -ro ../ogr/data/poly.shp')
if ret.find('ESRI Shapefile') == -1:
return 'fail'
return 'success'
示例11: test_ogrinfo_10
def test_ogrinfo_10():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' ../ogr/data/poly.shp poly -fid 9')
if ret.find('OGRFeature(poly):9') == -1:
return 'fail'
return 'success'
示例12: test_ogrinfo_14
def test_ogrinfo_14():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
(out, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' --mempreload', check_memleak = False )
if err.find('--mempreload option given without directory path') < 0:
print(err)
return 'fail'
return 'success'
示例13: test_ogrinfo_13
def test_ogrinfo_13():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
(out, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' --config', check_memleak = False )
if err.find('--config option given without a key and value argument') < 0:
print(err)
return 'fail'
return 'success'
示例14: test_ogrinfo_15
def test_ogrinfo_15():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
(ret, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' --debug on --mempreload ../ogr/data /vsimem/poly.shp', check_memleak = False )
if ret.find("ESRI Shapefile") < 0:
print(ret)
return 'fail'
return 'success'
示例15: test_ogrinfo_16
def test_ogrinfo_16():
if test_cli_utilities.get_ogrinfo_path() is None:
return 'skip'
(out, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' --debug', check_memleak = False )
if err.find('--debug option given without debug level') < 0:
print(err)
return 'fail'
return 'success'