Add a function to URL encoded dynamic symbolizer components in external graphic

Description

When pulling values using a CQL Expression the value is not URL encoded.

Using this as a reference:
http://docs.geoserver.org/latest/en/user/styling/sld-extensions/pointsymbols.html#dynamic-symbolizers.

Example:

<ExternalGraphic>
<OnlineResource xlink:type="simple"
xlink:href="http://mysite.com/tn_${STATE_ABBR}.jpg"/>
<Format>image/jpeg</Format>
</ExternalGraphic>

If the property value has a space in it, ie 'Some Value' the resulting url is: 'http://mysite.com/tn_Some Value.jpg'.

Expecting result to be 'http://mysite.com/tn_Some%20Value.jpg'

Environment

Java JDK: OpenJDK Runtime Environment (build 1.8.0_91-b14)
OS: Amazon Linux

Activity

Show:
Billy Newman
July 18, 2016, 8:44 PM
Edited

'a plausible fix would probably be a url encoding filter function to be called from inside the expression.', this is exactly what I have done for now and works great, thanks!

Would you agree that this is a fairly standard function to provide with the rest of the 'core' functions? I guess I would argue that you cannot really build a proper remote url without this function. Thoughts?

Andrea Aime
July 18, 2016, 8:54 PM

I agree such function would be useful in this context. That said, I believe this is the first request about it since dynamic symbolizers where introduced almost 8 years ago: http://blog.geoserver.org/2008/12/08/dynamic-symbolizers-part-1/
Regardless, importance is of small concern, with a small amount of developers busy to their teeth what really matters is resourcing (funding, or the random developer willing to spend the night or weekend to fix the issue for you).

Billy Newman
July 18, 2016, 9:00 PM

pull requests welcome?

Andrea Aime
July 19, 2016, 6:25 AM

Pull requests always welcomed!
The rendering and styling engine is down in GeoTools, that would be the best place to make a pull request. Guidelines here: https://github.com/geotools/geotools/blob/master/CONTRIBUTING.md

Andrea Aime
February 15, 2017, 11:48 AM

Mass closing all resolved issues not modified in the last 4 weeks

Fixed

Assignee

Unassigned

Reporter

Billy Newman

Triage

None

Fix versions

Affects versions

Components

Priority

Medium
Configure