geopython / MetaSearch

*** We have moved! MetaSearch is now a core QGIS plugin! (2014-11-30). See QGIS repository
https://hub.qgis.org/wiki/quantum-gis/MetaSearch
Other
4 stars 12 forks source link

URL Error messages #64

Closed LukeGIS closed 10 years ago

LukeGIS commented 10 years ago

Hi, I have tested MetaSearch on our catalog CSW: http://webgis.arpa.piemonte.it/geoportalserver_arpa/csw? When I try to connect WMS or WFS an error message appears (WMS url incorrect). After that if I chose OK and I modify the connection (without actually making any changes), and then try again, the connection works. To riproduce the problem you can try to load "Topografica - Quadri d'unione" (search by keywords "Quadri"). How I can solve this kind of issues? Is it a server side problem?

When I try to connect a WMTS services I get the following error and I cannot load the data: Error connecting to OGC: WMS / OGC: WMTS: 'NoneType' object has no attribute 'find' To riproduce the problem you can try to load "Arpa Piemonte - Sfumo_Europa_WM" (search by keywords "Sfumo_Europa_WM"). Could be the same problem discuss in this post??
https://github.com/geopython/MetaSearch/issues/23 It's possible to try your solutions?

Many thanks Luca

rduivenvoorde commented 10 years ago

This are two different issues, my comments are only about the first part.

The first one is because the server can apparently not handle double (service and request) parameters. The way we do it is using the capabilities url from the metadata record:

http://webgis.arpa.piemonte.it/ags101free/services/topografia_dati_di_base/Topografica_quadri_unione/MapServer/WMSServer?request=GetCapabilities&service=WMS

and give that to QGIS, but then QGIS fires the following url:

http://webgis.arpa.piemonte.it/ags101free/services/topografia_dati_di_base/Topografica_quadri_unione/MapServer/WMSServer?request=GetCapabilities&service=WMS&REQUEST=GETCAPABILITIES&SERVICE=WMS

which this server apparently cannot handle. IN the 'new connection' and 'edit connection' logic (which we do not hit), QGIS cleans up this parameters: https://github.com/qgis/QGIS/blob/master/src/gui/qgsnewhttpconnection.cpp#L199

I've tried to 'fake' this behaviour by doing:

        if service_type == 'OGC:WMS/OGC:WMTS':                               
            ows_provider.on_btnEdit_clicked() 

( https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmssourceselect.cpp#L182 ) but then you end up with an open 'connection'-dialog, which I do not know how to close it automatically...

@tomkralidis @alexbruy do you know a way to hit 'ok' for this dialog? Or else we have to remove this parameters ourselves (may be easier)

LukeGIS commented 10 years ago

Hi Richard, thanks for your help!

We temporarily solved the problem just removing the part of the link relative to the "GetCapabilities" from WMS and WFS URL on metadata server side. Now WMS and WFS services are loaded via the MetaSearch well. To riproduce you can try to load "Topografica - Quadri d'unione" (search by keywords "Quadri"). We have not really solved the problem within Qgis, it's just a workaround, but for us it works ....

We still have to solve the WMTS error, in this case it is not enough to change the WMTS URL..... The WMTS XML seems correct for XMLSpy .... But the error "Error connecting to OGC: WMS / OGC: WMTS: 'NoneType' object has no attribute 'find'" remains. Do you think there is a difference in behavior between the parameter "protocol" and "scheme" that we use?

Thanks for any indication. Luca

tomkralidis commented 10 years ago

@LukeGIS thanks for the info. As with #65, this is under discussion at http://lists.osgeo.org/pipermail/qgis-developer/2014-August/034415.html. If are no objections I will lift this functionality this week.

tomkralidis commented 10 years ago

@LukeGIS this is now fixed in master. Thanks for the feedback.