[Geoserver-users] SLD Question : Dynamic rotation

Dear All ..

My in one table of my datasource (storage=PostGis, type=POINT), I have column called "bearing" with type "double precission".
I want to display the points wil simple WellKnownName "Arrow", but I want to rotate it dynamicaly based on the value of "bearing" column.

I Tried this in SLD:
                <Rotation>
                    <CssParameter name="rotation"><ogc:PropertyName>bearing</ogc:PropertyName></CssParameter>
                </Rotation>

Note : complete sld attached

The Geoserver SLD validator said it's not-valid with msg :

----BEGIN ERROR---
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'CssParameter'. One of '{"http://www.opengis.net/ogc&quot;:expression\}' is expected.
----END ERROR---

How is the valid methode to do dynamic symbol rotation based on point attribute ?

Sincerely
-bino-

ttrack.xml (3.46 KB)

On Wed, Oct 13, 2010 at 6:57 AM, Bino Oetomo <bino@anonymised.com> wrote:

Dear All ..

My in one table of my datasource (storage=PostGis, type=POINT), I have
column called "bearing" with type "double precission".
I want to display the points wil simple WellKnownName "Arrow", but I want to
rotate it dynamicaly based on the value of "bearing" column.

I Tried this in SLD:
<Rotation>
<CssParameter
name="rotation"><ogc:PropertyName>bearing</ogc:PropertyName></CssParameter>
</Rotation>

Rotation takes an expression not a CssParameter so

              <Rotation>
                 <ogc:PropertyName>bearing</ogc:PropertyName>
              </Rotation>

should work fine

See http://gridlock.openplans.org/geoserver/2.0.x/doc/en/user/styling/sld-cookbook/points.html#rotated-square
for more details.

Ian

--
Ian Turton

Hi Ian ..
Ian Turton wrote:

Rotation takes an expression not a CssParameter so

              <Rotation>
                 <ogc:PropertyName>bearing</ogc:PropertyName>
              </Rotation>

should work fine

  See http://gridlock.openplans.org/geoserver/2.0.x/doc/en/user/styling/sld-cookbook/points.html#rotated-square
for more details.

Thankyou for your enlightment.
It work like a champ

-bino-