当前位置: 首页>>代码示例>>Python>>正文


Python WebFeatureService.alias方法代码示例

本文整理汇总了Python中owslib.wfs.WebFeatureService.alias方法的典型用法代码示例。如果您正苦于以下问题:Python WebFeatureService.alias方法的具体用法?Python WebFeatureService.alias怎么用?Python WebFeatureService.alias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在owslib.wfs.WebFeatureService的用法示例。


在下文中一共展示了WebFeatureService.alias方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_ows_interfaces_wfs

# 需要导入模块: from owslib.wfs import WebFeatureService [as 别名]
# 或者: from owslib.wfs.WebFeatureService import alias [as 别名]
def test_ows_interfaces_wfs():
    wfsxml = open(resource_file('mapserver-wfs-cap.xml'), 'rb').read()
    service = WebFeatureService('url', version='1.0', xml=wfsxml)
    # Check each service instance conforms to OWSLib interface
    service.alias = 'CSW'
    isinstance(service, owslib.feature.wfs100.WebFeatureService_1_0_0)
    # URL attribute
    assert service.url == 'url'
    # version attribute
    assert service.version == '1.0'
    # Identification object
    assert hasattr(service, 'identification')
    # Check all ServiceIdentification attributes
    assert service.identification.type == 'MapServer WFS'
    for attribute in ['type', 'version', 'title', 'abstract', 'keywords', 'accessconstraints', 'fees']:
        assert hasattr(service.identification, attribute)
    # Check all ServiceProvider attributes
    for attribute in ['name', 'url']:
        assert hasattr(service.provider, attribute)
    # Check all operations implement IOperationMetadata
    for op in service.operations:
        for attribute in ['name', 'formatOptions', 'methods']:
            assert hasattr(op, attribute)
    # Check all contents implement IContentMetadata as a dictionary
    isinstance(service.contents, dict)
    # Check any item (WCS coverage, WMS layer etc) from the contents of each service
    # Check it conforms to IContentMetadata interface
    # get random item from contents dictionary -has to be a nicer way to do this!
    content = service.contents[list(service.contents.keys())[0]]
    for attribute in ['id', 'title', 'boundingBox', 'boundingBoxWGS84', 'crsOptions', 'styles', 'timepositions']:
        assert hasattr(content, attribute)
开发者ID:PublicaMundi,项目名称:OWSLib,代码行数:33,代码来源:test_ows_interfaces.py


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