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

Styled Layer Descriptor (SLD) in STAC? #916

Closed
schwehr opened this issue Nov 5, 2020 · 9 comments
Closed

Styled Layer Descriptor (SLD) in STAC? #916

schwehr opened this issue Nov 5, 2020 · 9 comments

Comments

@schwehr
Copy link
Contributor

schwehr commented Nov 5, 2020

Does it make sense to allow for the use of SLD in STAC for specifying how one might visualize a collection or item? Is there a JSON version of SLD?

https://en.wikipedia.org/wiki/Styled_Layer_Descriptor

@cholmes
Copy link
Contributor

cholmes commented Nov 6, 2020

@schwehr - I think it could make sense as an additional asset. There is as of yet no SLD JSON that I know of. I imagine OGC API will retool styling at some point, but I don't think it's high on their list. Could perhaps be part of the rendering hints extension as it seems inline. Though as just an extra asset type it probably doesn't need its own extension, but it could be good to talk about it there.

There's nothing preventing making it an asset, so I'm interested to see if anyone does this. To make it work well we'd need clients that understand SLD, and I'm not sure most do.

@simonff
Copy link

simonff commented Nov 11, 2020

Chris - I'd like to find a styling approach to EE datasets in STAC sometime soon, as this is the only major point stopping us from fully converting to STAC. The fields we need are:
for rasters: min, max, gamma, gain, bias, palette, band list
for vectors: property name, color, line width, point size/shape
for both: lat/lon/zoom of preferred viewport

There can be more styling features requested, so I'm hesitant of creating a new small styling language when SLD exists. However, if many clients don't support it, what do they support?

My strawman proposal is to create an extension that is intended to mirror an existing standard (eg, "sld:"), or maybe just a subset of a standard to begin with.

@cholmes
Copy link
Contributor

cholmes commented Nov 12, 2020

@schwehr & @simonff - sounds great. Doing a subset of SLD as JSON makes good sense to me.

As discussed on gitter, the other major option seems to be the mapbox style spec. The OGC Styles API work seems to present SLD and mapbox styles as equally valid options. My one worry with SLD in JSON is that no one has done it so far (afaik), so it could end up as something no one really maintains.

@cportele - do you have any insight / recommendations on the future of json styling in OGC? The Google Earth Engine team wants to be able to specify a subset of rendering in their STAC implementation. I think their current plan is to try out their desired subset with both mapbox styles and a JSON version of SLD. We're definitely looking for something 'now', but if there's a way to align with future directions that'd be great.

@simonff
Copy link

simonff commented Nov 14, 2020

The most common style we use in Earth Engine is applying min and max to rasters (with implied colors: black for values below min, white for value above max, and interpolated grayscale in between). I don't see how to do this natively with either Mapbox or SLD.

SLD is close: a two-color ColorMap can be used., but the colors are required. We don't have to require them, though.

But Mapbox GL-JS does not have anything similar at all, AFAIU. There is this discussion about raster-colorize, but nothing has been implemented. I don't understand Mapbox expressions yet - maybe there is a way to take advantage of them? But they are not easy to use. This seems like a serious blocker for our purposes.

@simonff
Copy link

simonff commented Nov 14, 2020

@m-mohr m-mohr added this to the new extensions milestone Feb 27, 2021
@cholmes
Copy link
Contributor

cholmes commented Feb 27, 2021

@schwehr / @simonff - did you ever implement this? I think the straightforward route is just adding SLD xml as an asset. If you did this we could add to the spec that SLD is one of the types that can be used (hopefully it has a media type?), and then add a 'role' of 'styling' or something.

Or could do an extension if straight SLD xml wasn't used.

@simonff
Copy link

simonff commented Mar 1, 2021

Chris - we don't plan to work with SLD now, as it's too hard to express in it some simple patterns that we need.

@cholmes
Copy link
Contributor

cholmes commented Mar 1, 2021

Cool. If you've got a simple JSON style language I'm happy to use STAC to help promote it. But I think I'll close this issue for now.

@cholmes cholmes closed this as completed Mar 1, 2021
@schwehr
Copy link
Contributor Author

schwehr commented Aug 26, 2021

I've been told:

SLD doesn't handle raster min/max or gain/bias, as well as property selection for features or filter for image collections

So definitely not worth doing SLD.

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

No branches or pull requests

4 participants