EOX-A / QgsWcsClient2

A QGis WCS2.0/EO-WCS Plugin
Other
3 stars 2 forks source link

Error when parsing XML-responses #9

Closed hkristen closed 7 years ago

hkristen commented 7 years ago

Hi Christian,

I just recently discovered this Plugin as it seems to be a good way to expose data stored in a Rasdaman Server to users via QGIS. When using it in QGIS on a Windows machine, there is an error with lxml while connecting to a WCS server (EOXServer Reference Implementation or local Rasdaman Server)

My test system is following: Windows 10, QGIS 2.16.2 mit Python 2.7.5, pip 8.1.2 und lxml 3.6.4

2016-09-23T10:45:36 1 Traceback (most recent call last):
File "C:/Users/NAME/.qgis2/python/plugins\QgsWcsClient2\qgswcsclient2dialog.py", line 98, in new_function
function(self)
File "C:/Users/NAME/.qgis2/python/plugins\QgsWcsClient2\qgswcsclient2dialog.py", line 243, in connectServer
msg = self.eval_response(response, msg)
File "C:/Users/NAME/.qgis2/python/plugins\QgsWcsClient2\qgswcsclient2dialog.py", line 286, in eval_response
self.parse_first_xml(response[2])
File "C:/Users/NAME/.qgis2/python/plugins\QgsWcsClient2\qgswcsclient2dialog.py", line 344, in parse_first_xml
tree1 = etree.fromstring(join_xml)
File "src\lxml\lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src\lxml\lxml.etree.c:76696)
File "src\lxml\parser.pxi", line 1830, in lxml.etree._parseMemoryDocument (src\lxml\lxml.etree.c:115101)
File "src\lxml\parser.pxi", line 1718, in lxml.etree._parseDoc (src\lxml\lxml.etree.c:113781)
File "src\lxml\parser.pxi", line 1090, in lxml.etree._BaseParser._parseDoc (src\lxml\lxml.etree.c:108226)
File "src\lxml\parser.pxi", line 584, in lxml.etree._ParserContext._handleParseResultDoc (src\lxml\lxml.etree.c:102150)
File "src\lxml\parser.pxi", line 694, in lxml.etree._handleParseResult (src\lxml\lxml.etree.c:103800)
File "src\lxml\parser.pxi", line 624, in lxml.etree._raiseParseError (src\lxml\lxml.etree.c:102712)
XMLSyntaxError: Space required after the Public Identifier, line 1, column 50

This error has been reproduced by Christian Schiller on various servers, he says there seems to be a problem with the parsing of server-responses(GetCapabilities etc.). Also there seems to be an error with the interpolation settings in the GetCoverage tab.

This leads to the conclusion that there is a general problem with parsing XML-responses.

eox-cs1 commented 7 years ago

It will take 3-4 weeks before I can have a look at it. Sorry.

hkristen commented 7 years ago

Any updates on this issue?

eox-cs1 commented 7 years ago

Hi, Unfortunately I didn't had much time, so far to dive into it deeply. On the first issue - about the 2 Reference Implementation servers I could solve the issue: The 2 servers got a new address, but the QgsWcsClient2 doesn't resolve the redirects. An easy workaround is to replace the server URLs. The new URLs are: ) WCS 2.0/EO-WCS 1.0 - Reference Implemetation (EoxServer) -- NEW http://ows.eox.at/cite/eoxserver/ows? ) WCS 2.0 - Reference Implementation (MapServer) -- NEW http://ows.eox.at/cite/mapserver?

On the second issue - the problem with the parsing/setting the Interpolations, I could find the problem yet. But I will try to solve it as soon as I have a little bit more time. ciao Christian

hkristen commented 7 years ago

Hi Christian! I investigatd the error and I think I found a solution:

In the file "qgswcsclient2dialog.py" / line 354 you write: tree1 = etree.fromstring(join_xml)

I changed "fromstring" to "XML" as we are working with an XML not a string here: tree1 = etree.XML(join_xml)

Now I can connect to the two new you servers you provided, as well as to my local Rasdaman instance. The GetCapabilites & DescribeCoverage Tabs are working 100% but in the other tabs there are still some bugs:

eox-cs1 commented 7 years ago

fixed in v0.3