opengisch / qgis-swiss-locator

Swiss Geoadmin layer and feature search for QGIS 3
https://www.opengis.ch/2024/06/25/swiss-locator-plugin-3-0-is-here-with-exciting-features/
GNU General Public License v3.0
11 stars 4 forks source link

Avoid unnecessary Capabilities requests #88

Closed gacarrillor closed 1 month ago

gacarrillor commented 1 month ago

While parsing Opendata Swiss responses, we have a too broad condition (if "wms" in url.lower()) leading the plugin to go for resources like:

Title: WMS-Layer als Hintergrundkarten laden
Url: https://www.envidat.ch/dataset/seilaplan-tutorial-wms-layer-als-hintergrundkarten-laden/resource/18d13f78-0149-42bc-b962-fdd7bd972e4d
format: SERVICE

After this broad condition, I see there might be a code block with a wrong indentation, which makes the plugin always go for the resource (whose content in this case is malformed, thus the exception) as a WMS Capabilities resource, even if the resource didn't match another condition to be treated as a Capabilities one.

I guess it's a matter of fixing the indentation of this block to only perform the Capabilities request if it did match the aforementioned condition.

Fix #83

3nids commented 1 month ago

good catch