That sounds good .. and surprising it is not there already? Is it just not
a feature of SLD?

Default method very much appreciated to be kind to implementations. For a
default setter should it log a message, or throw a not implemented
exception?

If you are making an API change perhaps attack the channel traversal
problem directly with a default method to list all 4 channels...
--
Jody Garnett


On Feb 21, 2024 at 10:26:41 AM, Andrea Aime <
andrea.a...@geosolutionsgroup.com> wrote:

> Hi all,
> I'm looking into channel selection, and in particular, to add the ability
> to specify an alpha
> channel along with either RGB or Gray.
>
> XML wise that would look as follows:
>
> <ChannelSelection>
>   <RedChannel>
>     <SourceChannelName>3</SourceChannelName>
>   </RedChannel>
>   <GreenChannel>
>     <SourceChannelName>2</SourceChannelName>
>   </GreenChannel>
>   <BlueChannel>
>     <SourceChannelName>1</SourceChannelName>
>   </BlueChannel>
>   <AlphaChannel>
>     <SourceChannelName>4</SourceChannelName>
>   </AlphaChannel>
> </ChannelSelection>
>
> or:
>
> <ChannelSelection>
>   <GrayChannel>
>     <SourceChannelName>3</SourceChannelName>
>   </GrayChannel>
>   <AlphaChannel>
>     <SourceChannelName>4</SourceChannelName>
>   </AlphaChannel>
> </ChannelSelection>
>
> Now... API wise this a bit annoying as ChannelSelection does not have a
> list of channels, but separate methods for the gray and RGB cases:
>
>
> https://github.com/geotools/geotools/blob/main/modules/library/api/src/main/java/org/geotools/api/style/ChannelSelection.java#L23
>
> I would consider adding an alphaChannel getter/setter in that interface,
> with default implementation. Would that be ok?
> While it would not break compiling, it would still break semantics of
> visitors that care about channels (probably a minority) as they need to be
> updated to consider the new channel source. Would you consider this a
> blocker for backports?
>
> Code wise, I would expect to have to change the following:
>
>    - Core interface and implementation
>    - SLD 1.0 and 1.1 parser and encoder
>    - CSS and eventually YSLD
>    - The style builder in gt-browser
>    - All visitors in GT/GS that care about channels (e..g, the
>    duplicating one)
>    - The grid coverage renderer to actually perform the selection
>
> What do you think?
>
> Cheers
> Andrea
>
> ==
> GeoServer Professional Services from the experts!
>
> Visit http://bit.ly/gs-services-us for more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions Group
> phone: +39 0584 962313
>
> fax:     +39 0584 1660272
>
> mob:   +39  339 8844549
>
> https://www.geosolutionsgroup.com/
>
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
> Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
> 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
> precisa che ogni circostanza inerente alla presente email (il suo
> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>
> This email is intended only for the person or entity to which it is
> addressed and may contain information that is privileged, confidential or
> otherwise protected from disclosure. We remind that - as provided by
> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
> e-mail or the information herein by anyone other than the intended
> recipient is prohibited. If you have received this email by mistake, please
> notify us immediately by telephone or e-mail
> _______________________________________________
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to