3liz / QuickOSM

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

Documentation for preset styles is hard to understand #360

Open kannes opened 3 years ago

kannes commented 3 years ago

What is the bug?

The documentation for the associated qml style for presets says

https://github.com/3liz/QuickOSM/blob/32cad5057ffbe83d003e21303885e61bed06d7bb/QuickOSM/ui/edit_preset.py#L32

which made me try 'name of the preset'_'name of the query'_'layerNAME'.qml while I needed to use 'name of the preset'_'name of the query'_'layerGEOMETRYTYPE'.qml. I only found out when I looked at the files of the shipping Urban preset. This makes total sense and I had wondered how to specify different styles for different geometry layers but it was not obvious.

It would be great if it said something like 'name of the preset'_'name of the query'_'(points|lines|multilinestrings|multipolygons)'.qml instead. Though that is one long string and probably still hard to understand for some people :\ Maybe a dynamic list with the full filenames of the query that is currently edited and the output geometries that are selected?

Environment

Gustry commented 2 years ago

In the coming version, there is now a dedicated help button about QML. This is the generated text in the help :

To associate a QML style file for each layer, you must add the QML file(s) in this folder :
/home/etienne/.local/share/QGIS/QGIS3/profiles/default/QuickOSM/query_preset/amenity_restaurant_baume les dames

The name of the QML file must follow this convention : name of the preset_name of the query_geometry.qml

These parameters are separated by '_' and the geometry must be one these values : points, lines, multilinestrines, multipolygons.

For the given preset you are editing, this is the list of filename you can use :
amenity_restaurant_baume les dames_Query1_points.qml
amenity_restaurant_baume les dames_Query1_lines.qml
amenity_restaurant_baume les dames_Query1_multilinestrings.qml
amenity_restaurant_baume les dames_Query1_multipolygons.qml

Screenshot from 2022-06-08 21-09-22

I still keep the ticket open because I would like to improve it :

As a first step, does it sound good for you @kannes ? Feel free to review my frenglish :)

I have fixed the typo in the screenshot about multilinestrings. The text in the dialog is selectable to make the copy/paste.

kannes commented 2 years ago

Very cool! I love docs but be aware that my genglish (us Deutsche call it Denglisch) might also not be the best :D

Spontaneous thoughts and ideas:

I'd suggest to make the convention text have curly braces around the parts, this style is used in many places and in QGIS at least for the XYZ layer definitions: {name of the preset}_{name of the query}_{geometry}.qml.

For the "values" I'd personally use quotes like "points", "lines", ... to highlight them a bit.

Gustry commented 2 years ago

Thanks a lot, I'm taking your notes. Note that my previous message was already outdated, busy editing this part :)

Gustry commented 2 years ago
You can associate predefined styles with layers. You need to add QML file(s) in this folder :
/home/etienne/.local/share/QGIS/QGIS3/profiles/default/QuickOSM/query_preset/Restaurant_BOOO

The name of QML files must follow this convention : {name of the preset}_{name of the query}_{geometry}.qml

These parameters are separated by '_' and the geometry must be one these values : "points", "lines", "multilinestrings", "multipolygons".

For the current preset "Restaurant_BOOO"
and the current query "Query1"
this is the list of filenames you can use :
* Restaurant_BOOO_Query1_points.qml
* Restaurant_BOOO_Query1_lines.qml
* Restaurant_BOOO_Query1_multilinestrings.qml
* Restaurant_BOOO_Query1_multipolygons.qml
Gustry commented 2 years ago

Please try new version 2.1.0 which was released today.

I keep the ticket open, there are still some things I want to make better in this dialog.