Wonder if we split the "hint" into two - one for evaluating and one for
writing.

I am saying evaluating (rather than parsing) since the issue is found when
mbstyle constructs a filterfactory.literal("red").  The mbstyle parser
cannot control the use of hints when the renderer uses the resulting
Expression - literal.evaluates( feature, Color.class);

Looking at SLDTransformer encodeValue, there does not appear to be a place
to pass in a hint.

            if (expression instanceof Literal) {
                // use more compact encoding
                element(elementName, expression.evaluate(null,
String.class), atts);
            } else {
                start(elementName, atts);
                filterTranslator.encode(expression);
                end(elementName);
            }

Actually for expression evaluation I do not see a way to pass in a hint to
Converters.


--
Jody Garnett

On 25 April 2017 at 07:46, Andrea Aime <[email protected]> wrote:

> On Tue, Apr 25, 2017 at 4:05 PM, Jody Garnett <[email protected]>
> wrote:
>
>> I do not mind, it has the "danger" of making people write non standard
>> SLD files.
>>
>
> I don't see it as a big problem per se, we are not OGC cops (otherwise we
> would not have any vendor option),
> as long as the documentation is clear that using named color is a vendor
> extension.
>
>
>>
>> I know the SLD spec says it supports SvgParameters but they only have
>> examples of hex:
>>
>> *The “stroke” SvgParameter element gives the solid color that will be
>> used for a stroke. The color value is RGB-encoded using two hexadecimal
>> digits per primary-color component, in the order Red, Green, Blue, prefixed
>> with a hash (#) sign. The hexadecimal digits between A and F may be in
>> either uppercase or lowercase. For example, full red is encoded as
>> “#ff0000” (with no quotation marks). If the “stroke” SvgParameter element
>> is absent, the default color is defined to be black (“#000000”) in the
>> context of the LineSymbolizer. *
>>
>> I am sure for SVG based rendering engines they just pass the
>> SvgParameters through. So I do not see any harm in being more relaxed on
>> parsing.
>>
>> As for converting to a string, writing out Color.RED as "red", what are
>> your thoughts?
>>
>
> Now that is more problematic, and should be controllable, e.g., when
> writing SLD
> we should (imho) try to stick to a compliant color expression.
> And well, having multiple choices, I guess one should be preferred (the
> current one?) unless a hint is passed to the converter?
>
> Cheers
> Andrea
>
>
> --
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> phone: +39 0584 962313 <+39%200584%20962313>
> fax: +39 0584 1660272 <+39%200584%20166%200272>
> mob: +39  339 8844549 <+39%20339%20884%204549>
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> *AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
>
> Le informazioni contenute in questo messaggio di posta elettronica e/o
> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
> darcene notizia via e-mail e di procedere alla distruzione del messaggio
> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
> principi dettati dal D.Lgs. 196/2003.
>
>
>
> The information in this message and/or attachments, is intended solely for
> the attention and use of the named addressee(s) and may be confidential or
> proprietary in nature or covered by the provisions of privacy act
> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
> Code).Any use not in accord with its purpose, any disclosure, reproduction,
> copying, distribution, or either dissemination, either whole or partial, is
> strictly forbidden except previous formal approval of the named
> addressee(s). If you are not the intended recipient, please contact
> immediately the sender by telephone, fax or e-mail and delete the
> information in this message that has been received in error. The sender
> does not give any warranty or accept liability as the content, accuracy or
> completeness of sent messages and accepts no responsibility  for changes
> made after they were sent or for other risks which arise as a result of
> e-mail transmission, viruses, etc.
>
> -------------------------------------------------------
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to