OpenLayers

热力图样式

2017-06-13  本文已影响0人  八卦程序

热力图样式

<?xml version="1.0" encoding="UTF-8"?>
   <StyledLayerDescriptor version="1.0.0"
       xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
       xmlns="http://www.opengis.net/sld"
       xmlns:ogc="http://www.opengis.net/ogc"
       xmlns:xlink="http://www.w3.org/1999/xlink"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <NamedLayer>
       <Name>person_point_heat</Name>
       <UserStyle>
         <Title>person_point_heat</Title>
         <Abstract>A heatmap </Abstract>
         <FeatureTypeStyle>
           <Transformation>
             <ogc:Function name="gs:Heatmap">
               <ogc:Function name="parameter">
                 <ogc:Literal>data</ogc:Literal>
               </ogc:Function>
               <ogc:Function name="parameter">
                 <ogc:Literal>weightAttr</ogc:Literal>
                 <ogc:Literal>count_people</ogc:Literal>
               </ogc:Function>
               <ogc:Function name="parameter">
                 <ogc:Literal>radiusPixels</ogc:Literal>
                 <ogc:Function name="env">
                   <ogc:Literal>radius</ogc:Literal>
                   <ogc:Literal>35</ogc:Literal>
                 </ogc:Function>
               </ogc:Function>
               <ogc:Function name="parameter">
                 <ogc:Literal>pixelsPerCell</ogc:Literal>
                 <ogc:Literal>2</ogc:Literal>
               </ogc:Function>
               <ogc:Function name="parameter">
                 <ogc:Literal>outputBBOX</ogc:Literal>
                 <ogc:Function name="env">
                   <ogc:Literal>wms_bbox</ogc:Literal>
                 </ogc:Function>
               </ogc:Function>
               <ogc:Function name="parameter">
                 <ogc:Literal>outputWidth</ogc:Literal>
                 <ogc:Function name="env">
                   <ogc:Literal>wms_width</ogc:Literal>
                 </ogc:Function>
               </ogc:Function>
               <ogc:Function name="parameter">
                 <ogc:Literal>outputHeight</ogc:Literal>
                 <ogc:Function name="env">
                   <ogc:Literal>wms_height</ogc:Literal>
                 </ogc:Function>
               </ogc:Function>
             </ogc:Function>
           </Transformation>
          <Rule>
            <RasterSymbolizer>
            <!-- specify geometry attribute to pass validation -->
              <Geometry>
                <ogc:PropertyName>geom</ogc:PropertyName>
              </Geometry>
              <Opacity>1</Opacity>
                <ColorMap type="ramp" >
                  <ColorMapEntry color="#FFFFFF" quantity="0" opacity="0" label="FFFFF" />
                  <ColorMapEntry color="#7F95E6" quantity="0.1" opacity="0.5" label="7F95E6" />
                  <ColorMapEntry color="#7DFC3F" quantity="0.3" opacity="0.5" label="7DFC3F" />
                  <ColorMapEntry color="#F6FD01" quantity="0.4" opacity="0.5" label="F6FD01" />
                  <ColorMapEntry color="#EF8C07" quantity="0.5" opacity="0.5" label="EF8C07" />
                  <ColorMapEntry color="#FE0409" quantity="0.7" opacity="0.5" label="FE0409" />
                  <ColorMapEntry color="#FE0409" quantity="1" opacity="0.5" label="FE0409" />
                  </ColorMap>
            </RasterSymbolizer>
           </Rule>
         </FeatureTypeStyle>
       </UserStyle>
     </NamedLayer>
    </StyledLayerDescriptor>

上一篇下一篇

猜你喜欢

热点阅读