本文整理汇总了Python中Service.get_tagRequest方法的典型用法代码示例。如果您正苦于以下问题:Python Service.get_tagRequest方法的具体用法?Python Service.get_tagRequest怎么用?Python Service.get_tagRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service.get_tagRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gather_capabilities
# 需要导入模块: import Service [as 别名]
# 或者: from Service import get_tagRequest [as 别名]
def gather_capabilities(Nset, nameSet, cur, set_layers, list_WMSservers, server_URL):
# Generated file name
name_file = nameSet + ".xml"
# Product of an object class Document - dom
dom = xml.dom.minidom.Document()
# DTD schema takes one of the servers
Nwms_dtd = list_WMSservers[0]
# create service tag with need information (see Service.py).Return subtree dom
tag_service = Service.get_tag(dom, server_URL, nameSet, Nwms_dtd)
# create tag Capability.
capability = dom.createElement("Capability")
tag_service.appendChild(capability)
# create tag in Capability: Request
request_dom = dom.createElement("Request")
capability.appendChild(request_dom)
# Formated a tag Request with the intersection of all formats by all used servers
request_dom = Service.get_tagRequest(dom, "GetCapabilities", request_dom,\
server_URL, cur, list_WMSservers, nameSet, 0)
request_dom = Service.get_tagRequest(dom, "GetMap", request_dom, server_URL,\
cur, list_WMSservers, nameSet, 0)
request_dom = Service.get_tagRequest(dom, "GetFeatureInfo", request_dom, \
server_URL, cur, list_WMSservers, nameSet, 0)
request_dom = Service.get_tagRequest(dom, "DescribeLayer", request_dom, \
server_URL, cur, list_WMSservers, nameSet, 0)
request_dom = Service.get_tagRequest(dom, "GetLegendGraphic", request_dom, \
server_URL, cur, list_WMSservers, nameSet, 0)
Nwms_used = -1
count_servers = 0
oldlist_formats = []
for server_id in list_WMSservers:
# Enumerates all used servers
# Check their recurrence
if Nwms_used == server_id:
continue
Nwms_used = server_id
# Requested format of the tag with the name "Exception" of the server server_id
# SELECT xpath_nodeset(Capabilites, '"//Capability/Exception/Format"')
# FROM WMSresources
# WHERE Nwms = server_id;
res = BD.interset_request(cur, "WMSresources", "Capabilites",\
"//Capability/Exception/Format", "Nwms", server_id)
# Stores intersection list formats
result = []
if res:
# If there is a format
for tagFormat in res:
strformat = tagFormat.replace("</Format>", "</Format>\n")
if count_servers:
# This is not the first list of formats
oldlist_formats = list_formats
# The string format is divided into a list
list_formats = strformat.split("\n")
# Created by the intersection of the lists of formats belonging to two servers
for m in oldlist_formats:
for j in list_formats:
if m == j:
result.append(m)
break
# The result of suppresion of record in the list of formats
list_formats = result
else:
# This is the first list of formats
# The string format is divided into a list
list_formats = strformat.split("\n")
count_servers += 1
# Formed a string from the list of formats
strformat = " "
for k in list_formats:
strformat = strformat + "%s\n\t"%k
# Create tag "Exception"
exception = dom.createElement("Exception")
capability.appendChild(exception)
except_format = dom.createTextNode("%s" % strformat)
exception.appendChild(except_format)
count_servers = 0
Nwms_used = -1
oldlist_formats = " "
for server_id in list_WMSservers:
# Enumerates all used servers
result = " "
# Check their recurrence
if Nwms_used == server_id:
continue
Nwms_used = server_id
# Requested format of the tag with the name "Exception" of the server server_id
# SELECT xpath_nodeset(Capabilites, '"//Capability/UserDefinedSymbolization"')
# FROM WMSresources
# WHERE Nwms = server_id;
res = BD.interset_request(cur, "WMSresources", "Capabilites",\
"//Capability/UserDefinedSymbolization",\
"Nwms", server_id)
if res:
#.........这里部分代码省略.........