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

Conversation

griembauer
Copy link
Member

This PR adapts t.geoserver.publish to limit color options to those that GeoServer can handle. For color scales like magma, 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 the default 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

@griembauer griembauer requested a review from metzm December 12, 2022 14:56
@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants