3liz / QuickOSM

QGIS plugin to fetch OSM data with the Overpass API
GNU General Public License v2.0
180 stars 54 forks source link

Raise error if a key contains problematic whitespace #416

Closed kannes closed 1 year ago

kannes commented 1 year ago

If a user accidentally (or not) enters a key with some whitespace around it, they might not notice the whitespace and wonder why their query returned to no data. For example I copy and pasted "amenity" and took a really long time to find the issue of no data getting downloaded.

This PR checks all entered keys for leading or trailing whitespace to catch mistakes like that and raises a warning if found.

If the user really wants to download features with keys that have leading or trailing whitespace they can manually edit the query (says @Gustry).

PS: I did not test the test!

Gustry commented 1 year ago

LGTM, you even included tests indeed ;-)

You can edit CHANGELOG.md, in the "Unreleased" section :

* Add a warning if the key has a trailing white space (contribution from @kannes)