當前位置: 首頁>>代碼示例>>Python>>正文


Python WebFeatureService.getcapabilities方法代碼示例

本文整理匯總了Python中owslib.wfs.WebFeatureService.getcapabilities方法的典型用法代碼示例。如果您正苦於以下問題:Python WebFeatureService.getcapabilities方法的具體用法?Python WebFeatureService.getcapabilities怎麽用?Python WebFeatureService.getcapabilities使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在owslib.wfs.WebFeatureService的用法示例。


在下文中一共展示了WebFeatureService.getcapabilities方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: getODRL

# 需要導入模塊: from owslib.wfs import WebFeatureService [as 別名]
# 或者: from owslib.wfs.WebFeatureService import getcapabilities [as 別名]
def getODRL(serviceURL):
    wfs = WebFeatureService(serviceURL)
    wfs.getcapabilities()    

    candidateURLs = re.findall(r'(https?://[^\s]+)', wfs.identification.accessconstraints)
    for url in candidateURLs:        
        response = urllib2.urlopen(url)
        response_text = response.read()
        if is_valid_protocol(response_text):
            return response_text
    # If we are here, there is not any valid ODRL XML in any of the URLs in Access Constraints
    return None
開發者ID:IAAA-Lab,項目名稱:odrl-ogc-cache-policies,代碼行數:14,代碼來源:ODRL_Paper.py

示例2: WebFeatureService

# 需要導入模塊: from owslib.wfs import WebFeatureService [as 別名]
# 或者: from owslib.wfs.WebFeatureService import getcapabilities [as 別名]
# coding=utf-8
from owslib.wfs import WebFeatureService
# pokud nefunguje na pripojeni https, pouzijeme http
url = 'http://gis.nature.cz/arcgis/services/UzemniOchrana/Natura2000/MapServer/WFSServer'
aopk = WebFeatureService(url)

capabilities = aopk.getcapabilities()
print (capabilities.geturl())

print (u'{}\n{}\n{}\n{}\n{}'.format(aopk.provider.name,
                                    aopk.identification.title,
                                    aopk.identification.keywords[0],
                                    aopk.identification.fees,
                                    aopk.identification.abstract))

for rec in aopk.contents:
    print (rec)

url='http://gis.nature.cz/arcgis/services/UzemniOchrana/ChranUzemi/MapServer/WFSServer'
chranena_uzemi_wfs = WebFeatureService(url)
for rec in chranena_uzemi_wfs.contents:
    print (rec)

identifier = u'ChranUzemi:Zonace_velkoplošného_zvláště_chráněného_území'
print (chranena_uzemi_wfs.contents[identifier])
    
print ('{}\n{}'.format(chranena_uzemi_wfs.contents[identifier].boundingBox,
                       chranena_uzemi_wfs.contents[identifier].crsOptions))

# getfeature nepodporuje UTF-8, ani zakodovani timto zpusobem nemusi fungovat
identifier = 'ChranUzemi:Zonace_velkoplo\xc5\xa1n\xc3\xa9ho_zvl\xc3\xa1\xc5\xa1t\xc4\x9b_chr\xc3\xa1n\xc4\x9bn\xc3\xa9ho_\xc3\xbazem\xc3\xad'
開發者ID:GISMentors,項目名稱:geopython-zacatecnik,代碼行數:33,代碼來源:owslib-wfs-example.py


注:本文中的owslib.wfs.WebFeatureService.getcapabilities方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。