The label does show up, but the image does not. I verified that the image is
available at this url, and the log shows that the image is successfully
fetched.
I also tried using:
<Graphic>
<Mark>
<WellKnownName>square</WellKnownName>
<Fill>
<CssParameter name="fill">#ff0000</CssParameter>
<CssParameter name="fill-opacity">1.0</CssParameter>
</Fill>
</Mark>
<Size>8.0</Size>
</Graphic>
Instead of the Graphic tag above; that did not show, either.
By the way, I also tried the image in my styles directory, which is
something I've seen people recommend in this forum. As expected, that didn't
help.
Hi geoman. I've done a little bit of SLD troubleshooting. It is odd that the label is showing up but not the graphic. Some things that come to mind to test (please note that I am no expert):
1. Change the format of the graphic to something else (PNG?)
2. Take out all of the rules ogc:filters, or as much as possible
3. Make sure that this particular rule is at the very bottom of the SLD (to make sure that nothing is overprinting the shields)
This may not be the solution, but it may give you some more insight into the problem. Hope this helps.
Thanks,
Mike Pumphrey
Outreach Engineer
The Open Planning Project
geoman wrote:
I am trying to show highway shield graphics, but the shields are not showing.
Here is basically what I am doing:
The label does show up, but the image does not. I verified that the image is
available at this url, and the log shows that the image is successfully
fetched.
I also tried using:
<Graphic>
<Mark>
<WellKnownName>square</WellKnownName>
<Fill>
<CssParameter name="fill">#ff0000</CssParameter>
<CssParameter name="fill-opacity">1.0</CssParameter>
</Fill>
</Mark>
<Size>8.0</Size>
</Graphic>
Instead of the Graphic tag above; that did not show, either.
By the way, I also tried the image in my styles directory, which is
something I've seen people recommend in this forum. As expected, that didn't
help.
It looks like when I have a Rule with both a LineSymbolizer and a
PointSymbolizer for my roads, then the PointSymbolizer is ignored.
However, when I take out the LineSymbolizer, the PointSymbolizer repeats its
Graphic all along the road. I tried the VendorOption of group, which seems
to work for Labels with the TextSymbolizer, but that didn't improve the
display of the PointSymbolizer.
I have seen a few places (such as http://lyceum.massgis.state.ma.us/wiki/doku.php?id=wms:sld:graphics_with_labels_inside)
where the Graphic element is added to a TextSymbolizer. However, when I
tried this my styles would not validate under GeoServer. I saw a javadoc for
a TextSymbolizer2 which makes this work, but that had a comment calling it a
hack. I would like to do this in a way that won't break in a future release.
Is there an accepted way to get a road sign symbol under a route number in
GeoServer?
Hi, lucky for you "hacks" have a way of staying around for a while longer than you might think :). Saul can comment further but I believe this was the only way he could get this type of graphic labeling to work. So if it works for you, I think its probably safe to do. GeoServer will still render styles which are not "xml valid".
-Justin
geoman wrote:
It looks like when I have a Rule with both a LineSymbolizer and a
PointSymbolizer for my roads, then the PointSymbolizer is ignored.
However, when I take out the LineSymbolizer, the PointSymbolizer repeats its
Graphic all along the road. I tried the VendorOption of group, which seems
to work for Labels with the TextSymbolizer, but that didn't improve the
display of the PointSymbolizer.
I have seen a few places (such as http://lyceum.massgis.state.ma.us/wiki/doku.php?id=wms:sld:graphics_with_labels_inside)
where the Graphic element is added to a TextSymbolizer. However, when I
tried this my styles would not validate under GeoServer. I saw a javadoc for
a TextSymbolizer2 which makes this work, but that had a comment calling it a
hack. I would like to do this in a way that won't break in a future release.
Is there an accepted way to get a road sign symbol under a route number in
GeoServer?
--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com
Yep, this "graphics in a textsymbolizer" method was approved as a
geotools SLD extension back when I committed it, so it should stick
around for a while.
Plus my employer (who maintains that wiki where you found the sld
graphics with the label inside page) has a vested interest in keeping it
around, so they'll provide the coding power to keep it working if it
gets broken later.
--saul
On Thu, 2008-03-13 at 14:03 -0700, Justin Deoliveira wrote:
Hi, lucky for you "hacks" have a way of staying around for a while
longer than you might think :). Saul can comment further but I believe
this was the only way he could get this type of graphic labeling to
work. So if it works for you, I think its probably safe to do. GeoServer
will still render styles which are not "xml valid".
-Justin
geoman wrote:
> It looks like when I have a Rule with both a LineSymbolizer and a
> PointSymbolizer for my roads, then the PointSymbolizer is ignored.
>
> However, when I take out the LineSymbolizer, the PointSymbolizer repeats its
> Graphic all along the road. I tried the VendorOption of group, which seems
> to work for Labels with the TextSymbolizer, but that didn't improve the
> display of the PointSymbolizer.
>
> I have seen a few places (such as
> http://lyceum.massgis.state.ma.us/wiki/doku.php?id=wms:sld:graphics_with_labels_inside)
> where the Graphic element is added to a TextSymbolizer. However, when I
> tried this my styles would not validate under GeoServer. I saw a javadoc for
> a TextSymbolizer2 which makes this work, but that had a comment calling it a
> hack. I would like to do this in a way that won't break in a future release.
> Is there an accepted way to get a road sign symbol under a route number in
> GeoServer?
>
>