Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t.geoserver.publish: limit color options to those GeoServer can handle #4

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions t.geoserver.publish/t.geoserver.publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
# % type: string
# % required: no
# % multiple: no
# % options: bcyr,bgyr,blues,byg,byr,default,elevation,evi,forest_cover,grass,greens,grey,gyr,ndvi,ndwi,reds,ryb,ryg
# % label: Name of color table for layer styling
# %end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I add the default- answer, plus I limit the allowed options. Is this valid when using the macro? (probably yes as it only overwrites parts of the macro?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After testing, I would refrain from using # %option G_OPT_M_COLR, as together with using options it yields unclear Warnings when calling the module:

GRASS utm32n_wgs84/openeo_example_strds:~ > t.geoserver.publish input=S2_STRDS_B04_10m mosaic_layername=bla color=default
WARNUNG: Bug in UI description. Option 'aspect' in <color> does not exist
WARNUNG: Bug in UI description. Option 'aspectcolr' in <color> does not
         exist
WARNUNG: Bug in UI description. Option 'celsius' in <color> does not exist
WARNUNG: Bug in UI description. Option 'corine' in <color> does not exist
WARNUNG: Bug in UI description. Option 'curvature' in <color> does not
         exist
WARNUNG: Bug in UI description. Option 'differences' in <color> does not
         exist
WARNUNG: Bug in UI description. Option 'etopo2' in <color> does not exist
WARNUNG: Bug in UI description. Option 'fahrenheit' in <color> does not
         exist
WARNUNG: Bug in UI description. Option 'gdd' in <color> does not exist
WARNUNG: Bug in UI description. Option 'grey.eq' in <color> does not exist
WARNUNG: Bug in UI description. Option 'grey.log' in <color> does not exist
WARNUNG: Bug in UI description. Option 'grey1.0' in <color> does not exist
WARNUNG: Bug in UI description. Option 'grey255' in <color> does not exist
WARNUNG: Bug in UI description. Option 'haxby' in <color> does not exist
WARNUNG: Bug in UI description. Option 'inferno' in <color> does not exist
WARNUNG: Bug in UI description. Option 'kelvin' in <color> does not exist
WARNUNG: Bug in UI description. Option 'magma' in <color> does not exist
WARNUNG: Bug in UI description. Option 'nlcd' in <color> does not exist
WARNUNG: Bug in UI description. Option 'oranges' in <color> does not exist
WARNUNG: Bug in UI description. Option 'plasma' in <color> does not exist
WARNUNG: Bug in UI description. Option 'population' in <color> does not
         exist
WARNUNG: Bug in UI description. Option 'population_dens' in <color> does
         not exist
WARNUNG: Bug in UI description. Option 'precipitation' in <color> does not
         exist
WARNUNG: Bug in UI description. Option 'precipitation_daily' in <color>
         does not exist
WARNUNG: Bug in UI description. Option 'precipitation_monthly' in <color>
         does not exist
WARNUNG: Bug in UI description. Option 'rainbow' in <color> does not exist
WARNUNG: Bug in UI description. Option 'ramp' in <color> does not exist
WARNUNG: Bug in UI description. Option 'random' in <color> does not exist
WARNUNG: Bug in UI description. Option 'roygbiv' in <color> does not exist
WARNUNG: Bug in UI description. Option 'rstcurv' in <color> does not exist
WARNUNG: Bug in UI description. Option 'sepia' in <color> does not exist
WARNUNG: Bug in UI description. Option 'slope' in <color> does not exist
WARNUNG: Bug in UI description. Option 'soilmoisture' in <color> does not
         exist
WARNUNG: Bug in UI description. Option 'srtm' in <color> does not exist
WARNUNG: Bug in UI description. Option 'srtm_plus' in <color> does not
         exist
WARNUNG: Bug in UI description. Option 'terrain' in <color> does not exist
WARNUNG: Bug in UI description. Option 'viridis' in <color> does not exist
WARNUNG: Bug in UI description. Option 'water' in <color> does not exist
WARNUNG: Bug in UI description. Option 'wave' in <color> does not exist

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't the color names listed as ... does not exist those color names which you removed from the full list by defining a subset?
Seems the parser isn't prepared for that (yet).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes indeed. I meant they are "unclear" such that a user might not know what to do with this warning at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reported it upstream in OSGeo/grass#2708.


Expand Down Expand Up @@ -287,6 +288,8 @@ def main():
layername_prefix = options["layername_prefix"]
mosaic_layername = options["mosaic_layername"]
color = options["color"]
if color == "default":
color = None
color_rules = get_color_rules()

# get env variables
Expand Down