2

I work on GeoServer 2.6.2 and PosgreSQL 9.2 / PostGIS 2.0. I have declared a layer in GeoServer which is linked to a PostgreSQL database table. In this table, I have a column (obj_orientation) storing orientation values in grades (360° = 400 gr.). Is it possible to transform these values to degrees inside to SLD stylesheet?

I have tried these but the layer doesn't display at all:

<Rotation>
   <ogc:PropertyName>obj_orientation*0.9</ogc:PropertyName>
</Rotation>

<Rotation>${obj_orientation*0.9}</Rotation>

<Rotation>${obj_orientation}*0.9</Rotation>

Is there a way to do so or do I have to update my column in the database?

1

You should be able to use the mul function (see Filter Expressions). So something like:

<rotation>
   <mul>
      <literal>${obj_orientation}</literal>
      <literal>0.9</literal>
   </mul>
</rotation>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.