Details
Description
Extend the way in which external graphics can be
resolved in the main Geotools SLD parser.
As far as i know, you can now specify the location of an external
graphic in two ways:
- specify the location as a relative URL w.r.t. the SLD document URL
- specify the location as a java classpath resource
The first case assumes that the document URL is known and reachable,
which is not always the case (e.g. transfer of SLD over the wire or
configuring SLD in a database and so on). The second case is a nice
fallback in many circumstances but for web applications it is very
common to put graphics in a non-classpath location like the web context.
My suggestion is to make the location more customizable by adding a
resource locator to the SLD parser:
setOnlineResourceLocator(ResourceLocator resourceLocator);
where ResourceLocator would define the following:
public URL locateResource(String uri);
Justin, can I ask for a couple of sanity checks?
- is this going to affect your work on per workspace styles in GeoServer?
- what about gt-xsd SLD parsing, is the interface suitable to be used there as well? (thinking SLD 1.1 here)