• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python test_cli_utilities.get_ogrinfo_path函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中test_cli_utilities.get_ogrinfo_path函数的典型用法代码示例。如果您正苦于以下问题:Python get_ogrinfo_path函数的具体用法?Python get_ogrinfo_path怎么用?Python get_ogrinfo_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_ogrinfo_path函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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"')
开发者ID:AsgerPetersen,项目名称:gdal,代码行数:25,代码来源:test_ogr2ogr_py.py


示例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'
开发者ID:nextgis-borsch,项目名称:tests,代码行数:25,代码来源:test_ogrinfo.py


示例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
开发者ID:AsgerPetersen,项目名称:gdal,代码行数:7,代码来源:test_ogrinfo.py


示例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'
开发者ID:jef-n,项目名称:gdal,代码行数:27,代码来源:test_ogrinfo.py


示例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
开发者ID:AsgerPetersen,项目名称:gdal,代码行数:7,代码来源:test_ogrinfo.py


示例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
开发者ID:AsgerPetersen,项目名称:gdal,代码行数:7,代码来源:test_ogrinfo.py


示例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'
开发者ID:AsgerPetersen,项目名称:gdal,代码行数:8,代码来源:test_ogrinfo.py


示例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'
开发者ID:Joe-xXx,项目名称:gdal,代码行数:9,代码来源:test_ogrinfo.py


示例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'
开发者ID:Joe-xXx,项目名称:gdal,代码行数:9,代码来源:test_ogrinfo.py


示例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'
开发者ID:Joe-xXx,项目名称:gdal,代码行数:9,代码来源:test_ogrinfo.py


示例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'
开发者ID:Joe-xXx,项目名称:gdal,代码行数:9,代码来源:test_ogrinfo.py


示例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'
开发者ID:nextgis-borsch,项目名称:tests,代码行数:10,代码来源:test_ogrinfo.py


示例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'
开发者ID:nextgis-borsch,项目名称:tests,代码行数:10,代码来源:test_ogrinfo.py


示例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'
开发者ID:nextgis-borsch,项目名称:tests,代码行数:10,代码来源:test_ogrinfo.py


示例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'
开发者ID:nextgis-borsch,项目名称:tests,代码行数:10,代码来源:test_ogrinfo.py


示例16: test_ogrinfo_sql_filename

def test_ogrinfo_sql_filename():
    if test_cli_utilities.get_ogrinfo_path() is None:
        pytest.skip()

    open('tmp/my.sql', 'wt').write('-- initial comment\nselect * from poly\n-- trailing comment')
    (ret, err) = gdaltest.runexternal_out_and_err(test_cli_utilities.get_ogrinfo_path() + ' -q ../ogr/data/poly.shp -sql @tmp/my.sql')
    os.unlink('tmp/my.sql')
    assert (err is None or err == ''), 'got error/warning'
    assert 'OGRFeature(poly):0' in ret and 'OGRFeature(poly):9' in ret, \
        'wrong output'
开发者ID:AsgerPetersen,项目名称:gdal,代码行数:10,代码来源:test_ogrinfo.py


示例17: test_ogrinfo_21

def test_ogrinfo_21():
    if test_cli_utilities.get_ogrinfo_path() is None:
        return 'skip'

    ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' --locale C ../ogr/data/poly.shp', check_memleak = False )
    if ret.find("ESRI Shapefile") < 0:
        print(ret)
        return 'fail'

    return 'success'
开发者ID:nextgis-borsch,项目名称:tests,代码行数:10,代码来源:test_ogrinfo.py


示例18: test_ogrinfo_20

def test_ogrinfo_20():
    if test_cli_utilities.get_ogrinfo_path() is None:
        return 'skip'

    ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' --help-general', check_memleak = False )
    if ret.find('Generic GDAL utility command options') < 0:
        print(ret)
        return 'fail'

    return 'success'
开发者ID:nextgis-borsch,项目名称:tests,代码行数:10,代码来源:test_ogrinfo.py


示例19: test_ogrinfo_19

def test_ogrinfo_19():
    if test_cli_utilities.get_ogrinfo_path() is None:
        return 'skip'

    ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' --formats', check_memleak = False )
    if ret.find('ESRI Shapefile -vector- (rw+v): ESRI Shapefile') < 0:
        print(ret)
        return 'fail'

    return 'success'
开发者ID:nextgis-borsch,项目名称:tests,代码行数:10,代码来源:test_ogrinfo.py


示例20: test_ogrinfo_12

def test_ogrinfo_12():
    if test_cli_utilities.get_ogrinfo_path() is None:
        return 'skip'

    ret = gdaltest.runexternal(test_cli_utilities.get_ogrinfo_path() + ' --version', check_memleak = False )
    if ret.find(gdal.VersionInfo('--version')) != 0:
        print(ret)
        return 'fail'

    return 'success'
开发者ID:nextgis-borsch,项目名称:tests,代码行数:10,代码来源:test_ogrinfo.py



注:本文中的test_cli_utilities.get_ogrinfo_path函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap