*Relative Paths for Icons
*The short answer is, no, you can't make it do that. The problem is that
the CSS-SLD converter actually uses GeoTools' SLD writing code to generate
the SLD files, and GeoTools' SLD support is not symmetric (I mean it cannot
write everything that it can read.) Resolving relative paths into absolute
ones is a compromise between the actually desired behavior and not
supporting relative paths at all. This could probably be fixed at the
GeoTools level, but I haven't taken the time to inquire into why this
asymmetry was built in in the first place.
Why are relative paths a problem for you? Maybe there is a workaround that
could be used (for example, if it's a problem with relocating data
directories, I could add a tool to re-convert all CSS styles which would
re-resolve the paths.)
*
Icon Media Types*
The image type logic is not as sophisticated as you might expect - things
like dynamic symbolizers[1] make it impossible to know the media type for
the image in general, so I just threw my hands up and made it literally
'image/jpeg' if you don't specify. You can provide the media type
explicitly with the *fill-mime*, *stroke-mime*, *mark-mime*, or *shield-mime
* property. For example:
* {
fill: url(pattern.png);
fill-mime: "image/png";
}
I don't guess it would be too hard to make the CSS-SLD converter try to
look up the icon and inspect it to provide the default, but this is not as
big a priority to me as rendering transformations. If you want to look
into it let me know and I can give you some pointers on what's needed.
*Dynamic Color*
This is simply a bug (the color handling is a bit more complex than the
label handling, to allow for rgb() color syntax.) Again, this is probably
easily fixable given the time to work on it; I'd say even easier than smart
defaults for the icon mime-type property.
If you'd like to file bugs against GeoScript-Scala[2] I'll keep them
up-to-date if and when I get around to working on these problems.
[1]: http://blog.geoserver.org/2008/12/08/dynamic-symbolizers-part-1/
[2]: https://github.com/dwins/geoscript.scala/issues
On Thu, Dec 6, 2012 at 7:53 AM, Matthias Uden <[email protected]>wrote:
> Hi all,
>
> I've recently discovered the CSS module as an alternative to SLD styling
> and I'm quite enthusiastic about it. Still, I cannot accomplish
> everything I used to do with SLD before...
>
> Here are two specific questions:
>
> 1) When specifying a custom icon for a mark with url(...), is it
> possible to get a relative path in the generated SLD instead of an
> absolute one? Also, is there a possibility to specify the format of that
> image correctly? Currently, it is always converted to jpeg, even when I
> put in a png...
>
> Example:
> CSS:
> mark: url('icons/entry.png');
>
> SLD:
> <sld:ExternalGraphic>
> <sld:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:type="simple"
>
> xlink:href="file:/home/muden/test_geoserver/wms/map/geoserver/test_geoserver/styles/icons/entry.png"/>
> <sld:Format>image/jpeg</sld:Format>
> </sld:ExternalGraphic>
>
>
>
>
> 2) Specifying an attributes value dynamically using a column of the
> underlying DB table works fine for e.g. labels. However, it doesn't work
> for colors.
>
> Example (working):
> CSS:
> label: [key];
>
> SLD:
> <sld:Label>
> <ogc:PropertyName>key</ogc:PropertyName>
> </sld:Label>
>
> Example (not working):
> CSS:
> fill: [color];
>
> SLD:
> <sld:Fill/>
>
>
> Any help is appreciated!
> Thanks in advance and all the best,
> Matthias
>
>
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users