1

I've a custom WPS function gs:GetStyleSize, that I used to call from SLD like the following:

<FeatureTypeStyle>
    <Rule>
        <PointSymbolizer>
            <Graphic>
                <Mark>
                    <WellKnownName>circle</WellKnownName>
                    <Fill>
                        <CssParameter name="fill">#FF0000</CssParameter>
                    </Fill>
                </Mark>
                <Size>
                   <ogc:Function name="gs:GetStyleSize">
                    <ogc:Function name="parameter">
                        <ogc:Literal>style</ogc:Literal>
                        <ogc:PropertyName>style</ogc:PropertyName>
                    </ogc:Function>
                  </ogc:Function>
                </Size>
            </Graphic>
        </PointSymbolizer>
    </Rule>
</FeatureTypeStyle>

I need to convert this SLD to CSS, I tried the following:

/* @title gold point */
*{
    mark: symbol(circle);
    mark-size: gs:GetStyleSize(style);
    :mark {
        fill: #ffcc00;
    }
}

But when I click validate in the Geoserver's New Style page, I gives me the following error:

Invalid input ')', expected NameCharacter, OptionalWhiteSpace or Colon (line 4, column 37)

What's the correct way to call that function, or any other WPS function?

1 Answer 1

2

The CSS syntax does not allow to use functions with a colon in the middle of the name. Instead of building it as a WPS process, built it as a filter function instead, and you'll be able to give it a simple name callable by CSS.

See: http://docs.geotools.org/latest/userguide/tutorial/function.html

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.