本文整理汇总了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)