I'm trying to change the direction of the vector automatically.

I'm looking for in a NetCDF file the variable wd, but the vectors are all directed down, as if it were null

follows the result of ncdump -h from the file and the sld that I am tuning in GeoServer 2.12.1

ncdum -h

Code Sld

<StyledLayerDescriptor version="1.0.0"
                       xmlns="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml"
                       xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink"
                       xsi:schemaLocation="http://www.opengis.net/sld ./StyledLayerDescriptor.xsd">
          <ogc:Function name="ras:RasterAsPointCollection">
            <ogc:Function name="parameter">
            <!-- Activate the logic to recognize the emisphere -->
            <ogc:Function name="parameter">
            <ogc:Function name="parameter">
            <ogc:Function name="parameter">
              <ogc:Function name="Categorize">
                <ogc:Function name="env">
                <!-- this will generalize arrows -->
                  <CssParameter name="fill">#000000</CssParameter>
                  <CssParameter name="stroke">#000000</CssParameter>
                  <CssParameter name="stroke-width">0.2</CssParameter>
  • Could it simply be a difference in expected vs actual units, e.g., radians vs degrees? You could put the wd variable as a label in a text symbolizer to see its value. Other possibility, did you check in the geoserver layer panel what the actual name of the band is? If it's not "wd" but something else, you'd get a similar failure. – Andrea Aime Mar 22 '18 at 17:43
  • Hi Andrea, thanks for the feedback. Andrea on my band is like 'dir' I had placed wd, because I imagined that the sld would take the name of the variable itself. (I am new to geoserver and sld) I changed my rotation tag to: <Rotation> <ogc: Literal> dir </ ogc: Literal></ Rotation> The value of dir is in degrees. – Hugo Ferreira Mar 22 '18 at 19:07

If the band is named "dir" and it is in degrees, then the following change should do:


You might still have to account for differences in expected rotation direction (clockwise vs counterclockwise).

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.