本文整理汇总了Python中lds.LDSUtilities.LDSUtilities.getLayerNameFromURL方法的典型用法代码示例。如果您正苦于以下问题:Python LDSUtilities.getLayerNameFromURL方法的具体用法?Python LDSUtilities.getLayerNameFromURL怎么用?Python LDSUtilities.getLayerNameFromURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lds.LDSUtilities.LDSUtilities
的用法示例。
在下文中一共展示了LDSUtilities.getLayerNameFromURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: validateConnStr
# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import getLayerNameFromURL [as 别名]
def validateConnStr(self,cs):
'''WFS basic checks. 1 url format,2 api key,3 ask for wfs'''
if not re.search('^http://',cs,flags=re.IGNORECASE):
raise MalformedConnectionString('\'http\' declaration required in LDS request')
#if not re.search('wfs\.data\.linz\.govt\.nz',cs,flags=re.IGNORECASE):
# raise MalformedConnectionString('Require \'wfs.data.linz.govt.nz\' in LDS address string')
if not re.search('/[a-f0-9]{32}/(v/x|wfs\?)',cs,flags=re.IGNORECASE):
raise MalformedConnectionString('Require API key (32char hex) in LDS address string')
if not re.search('wfs\?',cs,flags=re.IGNORECASE):
raise MalformedConnectionString('Need to specify \'wfs?\' service in LDS request')
#look for conflicts
ulayer = LU.getLayerNameFromURL(cs)
return cs,ulayer
示例2: parseSourceConfig
# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import getLayerNameFromURL [as 别名]
def parseSourceConfig(self,sc):
'''If a user supplied their own LDS connection string, parse out relevant values'''
self.source_str = sc
#check for dates to set incr
ufd = LU.getDateStringFromURL('from',sc)
if ufd:
ufds = ufd.group(1)
ldslog.warn("Using 'from:' date string from supplied URL "+str(ufds))
self.fromdate = ufds
utd = LU.getDateStringFromURL('to',sc)
if utd:
utds = utd.group(1)
ldslog.warn("Using 'to:' date string from supplied URL "+str(utds))
self.todate = utds
#if doing incremental we also need to check changeset
if (utd or ufd) and not LU.checkHasChangesetIdentifier(sc):
raise InputMisconfigurationException("'changeset' identifier required for incremental LDS query")
#all going well we can now get the layer string. This isn't optional so we just set it
self.layer = LU.getLayerNameFromURL(sc)
ldslog.warn('Using layer selection from supplied URL '+str(self.layer))