用于QGIS的WFS 2.0.0插件中的WFS 2.0.0中的StoredQueries

时间:2013-07-10 08:54:53

标签: web-services geolocation maps qgis


我在主题为CadastralParcels的INSPIRE Web服务上测试storedQueries。当我在浏览器中运行它时,一切正常,但是当我尝试使用JürgenWeichand的WFS 2.0.0插件通过QGIS(版本1.8.0 Lisboa)获取功能时,我收到以下错误:

Traceback (most recent call last):
File "C:/Users/medm/.qgis//python/plugins\wfsclient\wfsclientdialog.py", line 727, in httpRequestFinished
root = ElementTree.parse(str(self.outFile.fileName())).getroot()
File "C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\xml\etree\ElementTree.py", line 1177, in parse
tree.parse(source, parser)
File "C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\xml\etree\ElementTree.py", line 654, in parse
self._root = parser.close()
File "C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\xml\etree\ElementTree.py", line 1636, in close
self._raiseerror(v)
File "C:\PROGRA~1\Quantum GIS Lisboa\apps\Python27\lib\xml\etree\ElementTree.py", line 1488, in _raiseerror
raise err
ParseError: no element found: line 1, column 0

Version of Python:
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]


QGIS version:
1.8.0-Lisboa Lisboa, f440b60

Python path: ['C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python', 
'C:/Users/medm/.qgis//python', 'C:/Users/medm/.qgis//python/plugins', 
'C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python/plugins',
'C:\\PROGRA~1\\Quantum GIS Lisboa\\bin\\python27.zip', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\DLLs', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\plat-win', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\lib-tk', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\qgis\\bin', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages',
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\PIL', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\win32', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\win32\\lib', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\Pythonwin', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode', 
'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\qgis\\python\\plugins\\fTools\\tools']

这是我在浏览器中使用的查询: http://services.cuzk.cz/wfs/inspire-cp-wfs.asp?service=wfs&version=2.0.0&request=getFeature&storedQuery_id=GetParcel&srsName=EPSG::5514&KATUZE_KOD=601527&TEXT_DEF_BOD=1


请注意,参数是用<Literal>标记括起来的,所以链接的真实地址是http://services.cuzk.cz/wfs/inspire-cp-wfs.asp?service=wfs&version=2.0.0&request=getFeature&storedQuery_id=GetParcel&srsName=EPSG::5514&KATUZE_KOD=<Literal xmlns="http://www.opengis.net/fes/2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string">601527</Literal>&TEXT_DEF_BOD=<Literal xmlns="http://www.opengis.net/fes/2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string">1</Literal>

同样,参数填写在QGIS WFS 2.0.0插件中:
我想给她一个截图,但我没有足够的声誉。 查询参数在浏览器和WFS 2.0.0插件中完全相同。然后,当我点击getFeatures时,我得到提到的错误 有谁能够帮我?或者有人有类似的问题吗?
感谢
米甲

1 个答案:

答案 0 :(得分:0)

我测试了你的例子:

  • Windows上的QGIS 1.8和WFS 2.0 Client 0.8.4→失败
  • Linux上的QGIS 1.8和WFS 2.0 Client 0.8.4→工作正常

我将对此进行更多调查(例如URL-Encoding)。

为什么使用fes:Literal而不是xs:String(或xs:int)作为参数?

GetFeature-使用fes的示例:Literal

http://services.cuzk.cz/wfs/inspire-cp-wfs.asp?service=WFS&request=GetFeature&version=2.0.0&STOREDQUERY_ID=GetParcel&KATUZE_KOD=<Literal xmlns="http://www.opengis.net/fes/2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string">601527</Literal>&TEXT_DEF_BOD=<Literal xmlns="http://www.opengis.net/fes/2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string">1</Literal>

可能的GetFeature - 使用xs:String

的示例
http://services.cuzk.cz/wfs/inspire-cp-wfs.asp?service=WFS&request=GetFeature&version=2.0.0&STOREDQUERY_ID=GetParcel&KATUZE_KOD=601527&TEXT_DEF_BOD=1