| Version 1 (modified by pedro.ribas, 10 years ago) (diff) |
|---|
Introdução
O Windbarbs é um estilo presente no Geoserver, capaz de desenhar bandeiras de vento, utilizando as informações de Direção e Magnitude dos ventos.
Requisitos
- É necessário ter o Geoserver instalado juntamente com o plugin ImageMosaic.
- Utiliza-se um arquivo .tiff contendo duas bandas, uma de Direção e outra de Magnitude dos ventos.
Como utilizar
- Primeiramente abra o Geoserver no navegador e em seguida faça login.
- Crie um Workspace, dê a ele um nome e uma descrição e salve.
- Vá até Stores e crie uma nova Store com o Plugin ImageMosaic, dê um nome e selecione a pasta que está o arquivo .tiff
- Vá até Styles e clique para adicionar um novo estilo, dê a ele o nome de Windbarbs, selecione o formato SLD e utilize o script que está no final da página.
- Publique o Layer que irá aparecer em sua tela.
- Entre na parte Publishing e adicione o estilo Windbarbs.
- Entre em LayerPreview veja a Layer publicada clicando em OpenLayers, em seguida clique em "..." e selecione o estilo Windbarbs.
Script Windbarbs
<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>windbarbs</Name>
<UserStyle>
<Title>windbarbs</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:Mul>
<ogc:PropertyName>mag</ogc:PropertyName>
<ogc:PropertyName>mag</ogc:PropertyName>
</ogc:Mul>
</ogc:Function>)[m/s]?emisphere=
<ogc:PropertyName>emisphere</ogc:PropertyName>
</WellKnownName>
<Stroke>
<CssParameter name="stroke">000000</CssParameter>
<CssParameter name="stroke-width">1</CssParameter>
</Stroke>
</Mark>
<Size>
<ogc:Function name="Categorize">
<ogc:PropertyName>mag</ogc:PropertyName>
<ogc:Literal>8</ogc:Literal>
<ogc:Literal>1.543333332</ogc:Literal>
<ogc:Literal>32</ogc:Literal>
</ogc:Function>
</Size>
<Rotation>
<ogc:Function name="Categorize">
<ogc:PropertyName>dir</ogc:PropertyName>
<!-- Output values and thresholds -->
<ogc:Literal>0</ogc:Literal>
<ogc:Literal>1.543333332</ogc:Literal>
<ogc:PropertyName>dir</ogc:PropertyName>
</ogc:Function>
</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>
</NamedLayer>
</StyledLayerDescriptor>
Observação
- Para utilizar o script seguinte é necessário que a sua fonte de dados tenha o arquivo de Direção e Magnitude em um .tiff com duas bandas.
