1

I am trying user Dynamic Symbolizers in my SLD:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd">
<NamedLayer>
    <Name>cite:test</Name>
    <UserStyle>
      <Title>Test</Title>
        <FeatureTypeStyle>
          <Rule>
            <PointSymbolizer>
              <Graphic>
                <ExternalGraphic>
                  <OnlineResource xlink:type="simple" xlink:href="http://localhost/icons/${some_type}"/>
                    <Format>image/png</Format>
                </ExternalGraphic>
              <Size>35</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

How if the value of 'some_type' has characters in it that need to be URL encoded the URL after parsing the CQL is invalid.

An easy example is if the value has a space in it i.e. 'Some Value'. Which produces the URL http://localhost/icons/Some Value, and it should probably produce: http://localhost/icons/Some%20Value.

Am I using CQL correctly in this instance. I looked through the provided functions here:

https://github.com/geotools/geotools/tree/master/modules/library/main/src/main/java/org/geotools/filter/function

and did not find one specific to URL encoding. That being said its not a huge deal to write a filter function to do this. However if you can use CQL in the href of an OnlineResource the core CQL parsing logic should probably handle this.

Is there anything else I might be missing? Crossing my fingers ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.