Okay, I dug around here a bit and I don't see any surprising behavior here. It looks like adding that Color->String conversion fixed the problem I was seeing as well, so even the first patch probably doesn't fix anything any more. Sorry for the noise.

--
David Winslow
OpenGeo - http://opengeo.org/

On 05/12/2010 09:33 PM, David Winslow wrote:
Oops, I commented on the GeoServer ticket before seeing this. For convenience I'll copy/paste:

    I'm not evaluating expressions anywhere; the CSS file gets
    converted to an instance of org.geotools.styling.Style and passed
    to GeoTools' SLDTransformer.transform(). When no color is
    specified for the label, the corresponding SLD Fill is created
    with StyleFactory.createFill(null, null, null, null) which seems
    to be the root of the problem. Anyway with the patch for GEOT-3036
    applied all should be well.


So, perhaps it is SLDTransformer that is not properly converting to a String when it is encoding Fills? I'll take a look in a few minutes when my checkout completes.

--
David Winslow
OpenGeo - http://opengeo.org/

On 05/12/2010 06:53 PM, Jody Garnett wrote:
Thanks David; next time can you supply a test case so we can show that the patch "does" something? (or indeed does anything?)

As Andrea indicated we should focus a bit more on getting patches in and reviewed so we can recommend new committers; in part by following the same procedure ourselves :-)

While the patch makes sense to me; I would expect if you called evaulate( expr, String.class ) the should both produce the same string?

Indeed if it is not meeting your expectations compare ... the ConstantExpression.color( Color ) code:

        String redCode = Integer.toHexString(color.getRed());
        String greenCode = Integer.toHexString(color.getGreen());
        String blueCode = Integer.toHexString(color.getBlue());

if (redCode.length() == 1) {
            redCode = "0" + redCode;
        }

if (greenCode.length() == 1) {
            greenCode = "0" + greenCode;
        }

if (blueCode.length() == 1) {
            blueCode = "0" + blueCode;
        }

        String colorCode = "#" + redCode + greenCode + blueCode;

With the code in ColorConverterFactory:

                    Color color = (Color) source;


                    String redCode = Integer.toHexString(color.getRed());
String greenCode = Integer.toHexString(color.getGreen()); String blueCode = Integer.toHexString(color.getBlue());

if (redCode.length() == 1) {
                        redCode = "0" + redCode;
                    }

if (greenCode.length() == 1) {
                        greenCode = "0" + greenCode;
                    }

if (blueCode.length() == 1) {
                        blueCode = "0" + blueCode;
                    }

return (T) ("#" + redCode + greenCode + blueCode).toUpperCase();

And tell me which code you want to keep?

Perhaps in your CSS code you are not evaluating to a String.class?

Jody

On 13/05/2010, at 1:03 AM, David Winslow wrote:

I have a tiny little patch that I'd love to see make it into this release:

http://jira.codehaus.org/browse/GEOT-3036

As far as I know this only shows itself in the GeoServer css community module, and there's an easy workaround, but it would be nice to get it working in GeoTools proper.

--
David Winslow
OpenGeo - http://opengeo.org/

On 05/11/2010 03:19 AM, Jody Garnett wrote:
We are going to get a GeoTools 2.6.4 out this week :-)

By happy chance both uDig and GeoServer are getting released at the same time; so this release of GeoTools will be subject to lots of testing.

Michael can your interpolate function be brought in from the cold? I think it has gotten some review now ...

Is there any other work waiting in the wings? My plan is to tag on Friday; allow GeoServer to go through Cite testing and if all goes well uploaded to SourceForge on Monday.

What can be done to help?
- answer this email if you have pending work (either to get in; or to be delayed until next week)
- testing the project zip when available
- go through Jira and look for issues that are already fixed
- blog posts about functionality added during the 2.6.4 release window
- testing!

Jody
------------------------------------------------------------------------------

_______________________________________________
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

------------------------------------------------------------------------------

_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to