-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
Conversation
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider to use the related macro
# %option G_OPT_M_COLR
see e.g.:
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This PR adapts
t.geoserver.publish
to limit color options to those that GeoServer can handle. For color scales likemagma, viridis
, etc. the GRASS color definition is so long that the output SLD is not accepted as GeoServer style. It is still possible to not provide a color (either by not filling the color parameter or choosing thedefault
value), in which case the result will be in grey values.This has the nice side effect that a drop-down menu with the available options is shown if the module is called via the OpenEO WebEditor