[Geoserver-users] Wind arrows

Hello,

I am not sure if I should use this mailing list to ask this question... correct me if I am wrong.

I have a geoTiff file containing U and V wind components in two separate bands and I am trying to display it on geoserver with arrows. I am on geoserver 2.6.2 and I am following the indications here : http://geoserver.geo-solutions.it/edu/fr/wps/rendering_tx.html

I have added the following style :

    <StyledLayerDescriptor version="1.0.0"
      xmlns="http://www.opengis.net/sld&quot; xmlns:gml="http://www.opengis.net/gml&quot;
      xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:xlink="http://www.w3.org/1999/xlink&quot;
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation="http://www.opengis.net/sld ./StyledLayerDescriptor.xsd">
      <NamedLayer>
        <Name>contour_lines</Name>
        <UserStyle>
          <FeatureTypeStyle>
            <Transformation>
              <ogc:Function name="gs:RasterAsPointCollection">
                <ogc:Function name="parameter">
                  <ogc:Literal>data</ogc:Literal>
                </ogc:Function>
              </ogc:Function>
            </Transformation>
            <Rule>
              <TextSymbolizer>
                <Label><![CDATA]></Label> <!-- fake label -->
                <Graphic>
                  <Mark>
                    <WellKnownName>shape://carrow</WellKnownName>
                    <Fill>
                      <CssParameter name="fill">#000000</CssParameter>
                    </Fill>
                  </Mark>
                  <Size>
                    <ogc:Mul>
                    <ogc:Function name="sqrt">
                      <ogc:Add>
                        <ogc:Mul>
                          <ogc:PropertyName>Band1</ogc:PropertyName>
                          <ogc:PropertyName>Band1</ogc:PropertyName>
                        </ogc:Mul>
                        <ogc:Mul>
                          <ogc:PropertyName>Band2</ogc:PropertyName>
                          <ogc:PropertyName>Band2</ogc:PropertyName>
                        </ogc:Mul>
                      </ogc:Add>
                    </ogc:Function>
                    <ogc:Literal>200</ogc:Literal>
                    </ogc:Mul>
                  </Size>
                  <Rotation>
                     <ogc:Function name="toDegrees">
                       <ogc:Function name="atan2">
                            <ogc:PropertyName>Band2</ogc:PropertyName>
                            <ogc:PropertyName>Band1</ogc:PropertyName>
                       </ogc:Function>
                    </ogc:Function>
                  </Rotation>
                </Graphic>
                <Priority>
                  <ogc:Add>
                    <ogc:Mul>
                      <ogc:PropertyName>Band1</ogc:PropertyName>
                      <ogc:PropertyName>Band1</ogc:PropertyName>
                    </ogc:Mul>
                    <ogc:Mul>
                      <ogc:PropertyName>Band2</ogc:PropertyName>
                      <ogc:PropertyName>Band2</ogc:PropertyName>
                    </ogc:Mul>
                  </ogc:Add>
                </Priority>
              </TextSymbolizer>
            </Rule>
          </FeatureTypeStyle>
        </UserStyle>
      </NamedLayer>
    </StyledLayerDescriptor>

And when I added my layer, I renamed the two bands in Band1 and Band2 and selected the style.

But when previewing the layer, it stays desperately blank without any error message.

Do you have any idea where I should look for to solve this issue ?

Thanks !
Pierre.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Hi PIerre,
question, are you reprojecting the raster data in the process?
In other words, is your request coordinate reference system different than the data one?

We have had reports that something is not working in those cases, and the output remains
blank, but haven’t had time to look into it so far.

Cheers
Andrea

···

On Fri, May 29, 2015 at 1:28 PM, VILLARD, Pierre <pierre.villard@anonymised.com> wrote:

Hello,

I am not sure if I should use this mailing list to ask this question… correct me if I am wrong.

I have a geoTiff file containing U and V wind components in two separate bands and I am trying to display it on geoserver with arrows. I am on geoserver 2.6.2 and I am following the indications here : http://geoserver.geo-solutions.it/edu/fr/wps/rendering_tx.html

I have added the following style :



contour_lines



<ogc:Function name=“gs:RasterAsPointCollection”>
<ogc:Function name=“parameter”>
ogc:Literaldata</ogc:Literal>
</ogc:Function>
</ogc:Function>






shape://carrow

#000000



ogc:Mul
<ogc:Function name=“sqrt”>
ogc:Add
ogc:Mul
ogc:PropertyNameBand1</ogc:PropertyName>
ogc:PropertyNameBand1</ogc:PropertyName>
</ogc:Mul>
ogc:Mul
ogc:PropertyNameBand2</ogc:PropertyName>
ogc:PropertyNameBand2</ogc:PropertyName>
</ogc:Mul>
</ogc:Add>
</ogc:Function>
ogc:Literal200</ogc:Literal>
</ogc:Mul>


<ogc:Function name=“toDegrees”>
<ogc:Function name=“atan2”>
ogc:PropertyNameBand2</ogc:PropertyName>
ogc:PropertyNameBand1</ogc:PropertyName>
</ogc:Function>
</ogc:Function>



ogc:Add
ogc:Mul
ogc:PropertyNameBand1</ogc:PropertyName>
ogc:PropertyNameBand1</ogc:PropertyName>
</ogc:Mul>
ogc:Mul
ogc:PropertyNameBand2</ogc:PropertyName>
ogc:PropertyNameBand2</ogc:PropertyName>
</ogc:Mul>
</ogc:Add>






And when I added my layer, I renamed the two bands in Band1 and Band2 and selected the style.

But when previewing the layer, it stays desperately blank without any error message.

Do you have any idea where I should look for to solve this issue ?

Thanks !
Pierre.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.



Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
Meet us at the INSPIRE Conference in Lisbon 25-29 May 2015! Visit http://goo.gl/WHKDXT for more information.

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Hi Andrea,

No I am not doing any reprojection according to me.

I just had a closer look in my logs, and I just saw :

29 May 13:11:17 INFO [geoserver.wms] -
Request: getMap
        Transparent = false
        SldBody = null
        ValidateSchema = false
        Sld = null
        StyleUrl = null
        Width = 681
        Height = 330
        Crs = GEOGCS["WGS 84",
  DATUM["World Geodetic System 1984",
    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
  UNIT["degree", 0.017453292519943295],
  AXIS["Geodetic longitude", EAST],
  AXIS["Geodetic latitude", NORTH],
  AUTHORITY["EPSG","4326"]]
        Bbox = SRSEnvelope[-238.80086411973 : 238.91716479437, -115.66365614516 : 115.82966183084]
        RemoteOwsType = null
        RemoteOwsURL = null
        Env = {}
        Angle = 0.0
        CQLFilter = null
        Elevation =
        FeatureId = null
        StartIndex = null
        ViewParams = null
        StyleFormat = sld
        TilesOrigin = null
        Tiled = false
        Palette = null
        SRS = EPSG:4326
        FeatureVersion = null
        Styles = [StyleImpl[ name=NOAA-Wind]]
        Layers = [org.geoserver.wms.MapLayerInfo@...7082...]
        MaxFeatures = null
        BgColor = java.awt.Color[r=255,g=255,b=255]
        FormatOptions = {}
        Exceptions = SE_XML
        StyleBody = null
        SldVersion = null
        StyleVersion = null
        Time =
        Filter = null
        Buffer = 0
        Format = image/jpeg
        Filters = null
        BaseUrl = http://localhost:8080/geoserver/
        RawKvp = {BBOX=-238.80086411973,-115.66365614516,238.91716479437,115.82966183084, VERSION=1.1.1, FORMAT=image/jpeg, SERVICE=WMS, HEIGHT=330, LAYERS=NOAA-Wind:dWind, REQUEST=GetMap, STYLES=NOAA-Wind, SRS=EPSG:4326, WIDTH=681}
        Get = true
        RequestCharset = UTF-8
        Version = 1.1.1
        Request = GetMap
29 May 13:13:20 ERROR [wicket.RequestCycle] - Filter Function problem for function toDegrees argument #0 - expected type double
java.lang.IllegalArgumentException: Filter Function problem for function toDegrees argument #0 - expected type double
        at org.geotools.filter.function.math.FilterFunction_toDegrees.evaluate(FilterFunction_toDegrees.java:50)
        at org.geotools.filter.expression.ExpressionAbstract.evaluate(ExpressionAbstract.java:65)
        at org.geotools.renderer.style.SLDStyleFactory.evalToDouble(SLDStyleFactory.java:1535)
        at org.geotools.renderer.style.SLDStyleFactory.createPointStyle(SLDStyleFactory.java:574)
        at org.geotools.renderer.style.SLDStyleFactory.createTextStyle(SLDStyleFactory.java:832)
        at org.geotools.renderer.style.SLDStyleFactory.createStyleInternal(SLDStyleFactory.java:377)
        at org.geotools.renderer.style.SLDStyleFactory.createStyle(SLDStyleFactory.java:321)
        at org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.buildLegendGraphic(BufferedImageLegendGraphicBuilder.java:400)
        at org.geoserver.wms.web.data.AbstractStylePage$6$1.getData(AbstractStylePage.java:263)
        at org.apache.wicket.markup.html.DynamicWebResource$ResourceState.getLength(DynamicWebResource.java:89)
        at org.apache.wicket.markup.html.DynamicWebResource$1.length(DynamicWebResource.java:241)
        at org.apache.wicket.request.target.resource.ResourceStreamRequestTarget.configure(ResourceStreamRequestTarget.java:241)
        at org.apache.wicket.request.target.resource.ResourceStreamRequestTarget.respond(ResourceStreamRequestTarget.java:150)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
        at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1267)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1334)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
...

Is it normal that there are more than 2 minutes between the two logs ?

Regarding the error, not sure to understand why. If correctly understand the style definition :

                  <Rotation>
                     <ogc:Function name="toDegrees">
                       <ogc:Function name="atan2">
                            <ogc:PropertyName>Band2</ogc:PropertyName>
                            <ogc:PropertyName>Band1</ogc:PropertyName>
                       </ogc:Function>
                    </ogc:Function>
                  </Rotation>

It would mean than the output of atan2 cannot be an input of toDegrees ?

As far as I look into my input file, everything looks OK regarding the values (between -35 and 96 for U, and between -59 and 61 for V).

De : andrea.aime@...84... [mailto:andrea.aime@…84…] De la part de Andrea Aime
Envoyé : vendredi 29 mai 2015 14:05
À : VILLARD, Pierre
Cc : geoserver-users@lists.sourceforge.net
Objet : Re: [Geoserver-users] Wind arrows

Hi PIerre,
question, are you reprojecting the raster data in the process?
In other words, is your request coordinate reference system different than the data one?

We have had reports that something is not working in those cases, and the output remains
blank, but haven't had time to look into it so far.

Cheers
Andrea

On Fri, May 29, 2015 at 1:28 PM, VILLARD, Pierre <pierre.villard@...5083...> wrote:
Hello,

I am not sure if I should use this mailing list to ask this question... correct me if I am wrong.

I have a geoTiff file containing U and V wind components in two separate bands and I am trying to display it on geoserver with arrows. I am on geoserver 2.6.2 and I am following the indications here : http://geoserver.geo-solutions.it/edu/fr/wps/rendering_tx.html

I have added the following style :

&lt;StyledLayerDescriptor version=&quot;1\.0\.0&quot;
  xmlns=&quot;http://www.opengis.net/sld&quot; xmlns:gml=&quot;http://www.opengis.net/gml&quot;
  xmlns:ogc=&quot;http://www.opengis.net/ogc&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;
  xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://www.opengis.net/sld \./StyledLayerDescriptor\.xsd&quot;&gt;
  &lt;NamedLayer&gt;
    &lt;Name&gt;contour\_lines&lt;/Name&gt;
    &lt;UserStyle&gt;
      &lt;FeatureTypeStyle&gt;
        &lt;Transformation&gt;
          &lt;ogc:Function name=&quot;gs:RasterAsPointCollection&quot;&gt;
            &lt;ogc:Function name=&quot;parameter&quot;&gt;
              &lt;ogc:Literal&gt;data&lt;/ogc:Literal&gt;
            &lt;/ogc:Function&gt;
          &lt;/ogc:Function&gt;
        &lt;/Transformation&gt;
        &lt;Rule&gt;
          &lt;TextSymbolizer&gt;
            &lt;Label&gt;&lt;\!\[CDATA\[ \]\]&gt;&lt;/Label&gt; &lt;\!\-\- fake label \-\-&gt;
            &lt;Graphic&gt;
              &lt;Mark&gt;
                &lt;WellKnownName&gt;shape://carrow&lt;/WellKnownName&gt;
                &lt;Fill&gt;
                  &lt;CssParameter name=&quot;fill&quot;&gt;\#000000&lt;/CssParameter&gt;
                &lt;/Fill&gt;
              &lt;/Mark&gt;
              &lt;Size&gt;
                &lt;ogc:Mul&gt;
                &lt;ogc:Function name=&quot;sqrt&quot;&gt;
                  &lt;ogc:Add&gt;
                    &lt;ogc:Mul&gt;
                      &lt;ogc:PropertyName&gt;Band1&lt;/ogc:PropertyName&gt;
                      &lt;ogc:PropertyName&gt;Band1&lt;/ogc:PropertyName&gt;
                    &lt;/ogc:Mul&gt;
                    &lt;ogc:Mul&gt;
                      &lt;ogc:PropertyName&gt;Band2&lt;/ogc:PropertyName&gt;
                      &lt;ogc:PropertyName&gt;Band2&lt;/ogc:PropertyName&gt;
                    &lt;/ogc:Mul&gt;
                  &lt;/ogc:Add&gt;
                &lt;/ogc:Function&gt;
                &lt;ogc:Literal&gt;200&lt;/ogc:Literal&gt;
                &lt;/ogc:Mul&gt;
              &lt;/Size&gt;
              &lt;Rotation&gt;
                 &lt;ogc:Function name=&quot;toDegrees&quot;&gt;
                   &lt;ogc:Function name=&quot;atan2&quot;&gt;
                        &lt;ogc:PropertyName&gt;Band2&lt;/ogc:PropertyName&gt;
                        &lt;ogc:PropertyName&gt;Band1&lt;/ogc:PropertyName&gt;
                   &lt;/ogc:Function&gt;
                &lt;/ogc:Function&gt;
              &lt;/Rotation&gt;
            &lt;/Graphic&gt;
            &lt;Priority&gt;
              &lt;ogc:Add&gt;
                &lt;ogc:Mul&gt;
                  &lt;ogc:PropertyName&gt;Band1&lt;/ogc:PropertyName&gt;
                  &lt;ogc:PropertyName&gt;Band1&lt;/ogc:PropertyName&gt;
                &lt;/ogc:Mul&gt;
                &lt;ogc:Mul&gt;
                  &lt;ogc:PropertyName&gt;Band2&lt;/ogc:PropertyName&gt;
                  &lt;ogc:PropertyName&gt;Band2&lt;/ogc:PropertyName&gt;
                &lt;/ogc:Mul&gt;
              &lt;/ogc:Add&gt;
            &lt;/Priority&gt;
          &lt;/TextSymbolizer&gt;
        &lt;/Rule&gt;
      &lt;/FeatureTypeStyle&gt;
    &lt;/UserStyle&gt;
  &lt;/NamedLayer&gt;
&lt;/StyledLayerDescriptor&gt;

And when I added my layer, I renamed the two bands in Band1 and Band2 and selected the style.

But when previewing the layer, it stays desperately blank without any error message.

Do you have any idea where I should look for to solve this issue ?

Thanks !
Pierre.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--

Meet us at the INSPIRE Conference in Lisbon 25-29 May 2015! Visit http://goo.gl/WHKDXT for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.

-------------------------------------------------------