Geoserver SLD样式-风钩

时间:2019-03-04 15:07:09

标签: geoserver sld

我正在尝试根据两个波段的tiff(geoserver 2.15)动态绘制风钩。我的清单如下:

<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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld ./StyledLayerDescriptor.xsd">   <NamedLayer>
 <Name>Wind</Name>
 <UserStyle>
   <Title>Wind</Title>
   <FeatureTypeStyle>
     <Transformation>
           <ogc:Function name="ras:RasterAsPointCollection">
              <ogc:Function name="parameter">
                 <ogc:Literal>data</ogc:Literal>
              </ogc:Function>
              <!-- Activate the logic to recognize the emisphere -->
              <ogc:Function name="parameter">
                <ogc:Literal>emisphere</ogc:Literal>
                <ogc:Literal>True</ogc:Literal>
              </ogc:Function>
              <ogc:Function name="parameter">
                <ogc:Literal>interpolation</ogc:Literal>
                <ogc:Literal>InterpolationBilinear</ogc:Literal>
              </ogc:Function>                 
              <ogc:Function name="parameter">
                <ogc:Literal>scale</ogc:Literal>
                <ogc:Function name="Categorize">
                 <ogc:Function name="env">
                   <ogc:Literal>wms_scale_denominator</ogc:Literal>
                 </ogc:Function>                      
                   <ogc:Literal>16</ogc:Literal>
                   <ogc:Literal>100000</ogc:Literal>
                   <ogc:Literal>8</ogc:Literal>
                   <ogc:Literal>500000</ogc:Literal>
                   <ogc:Literal>2</ogc:Literal>
                   <ogc:Literal>1000000</ogc:Literal>
                   <ogc:Literal>0.5</ogc:Literal>
                   <ogc:Literal>5000000</ogc:Literal>
                   <ogc:Literal>0.2</ogc:Literal>
                   <ogc:Literal>10000000</ogc:Literal>
                   <ogc:Literal>0.1</ogc:Literal>
                   <ogc:Literal>20000000</ogc:Literal>
                   <ogc:Literal>0.05</ogc:Literal>
                   <ogc:Literal>60000000</ogc:Literal>
                   <ogc:Literal>0.02</ogc:Literal>                     
                </ogc:Function>
              </ogc:Function>                 
           </ogc:Function>
        </Transformation>
     <Rule>           
      <PointSymbolizer>
        <Graphic>
          <Mark>
            <WellKnownName>windbarbs://default(
               <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>)[m/s]?emisphere=n
            </WellKnownName>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">1</CssParameter>
            </Stroke> 
          </Mark>
                  <Size>
                    <ogc:Function name="Categorize">
                          <!-- Value to transform -->
                         <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>6</ogc:Literal>
                          <ogc:Literal>1.543333332</ogc:Literal>
                          <ogc:Literal>24</ogc:Literal>
                       </ogc:Function>
                   </Size>              
                      <Rotation>
                        <ogc:Add>
                      <ogc:Function name="Categorize">
                           <!-- Value to transform -->
                           <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>

                           <!-- Output values and thresholds -->
                           <ogc:Literal>0</ogc:Literal>
                           <ogc:Literal>1.543333332</ogc:Literal>

                            <ogc:Function name="toDegrees">
                        <ogc:Function name="atan2">
                        <ogc:PropertyName>Band1</ogc:PropertyName>
                        <ogc:PropertyName>Band2</ogc:PropertyName>
                     </ogc:Function>
                      </ogc:Function>
                    </ogc:Function>
                        <ogc:Literal>180</ogc:Literal>
                          </ogc:Add>
                 </Rotation>
        </Graphic>
      </PointSymbolizer>           
       <PointSymbolizer>
              <Graphic>
                 <Mark>
                   <WellKnownName>circle</WellKnownName>
                    <Fill>
                       <CssParameter name="fill">
                          <ogc:Literal>#ff0000</ogc:Literal>
                       </CssParameter>
                    </Fill>
                 </Mark>
                 <Size>3</Size>
              </Graphic>
           </PointSymbolizer>           
    </Rule>
  </FeatureTypeStyle>
</UserStyle>

但是出现以下错误:

  

code =“ internalError”渲染过程失败   无法评估流程函数,错误为:java.lang.IllefalArgumentExceptionQ指定的维   参数为非正值。

同一个sld在Geoserver 2.7.4中运行良好。

如果我删除了scale和wms_scale_denominator因子,它可以工作,但是我有太多倒钩部分重叠,从而使地图不可读。

为了使用此版本的geoserver,我需要在SLD中进行哪些更改?

0 个答案:

没有答案