geoserver动态颜色参数样式、动态sql配置实现
生活随笔
收集整理的這篇文章主要介紹了
geoserver动态颜色参数样式、动态sql配置实现
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
動態顏色參數樣式、動態sql
訪問方式:
http://localhost:20011/geoserver/gzzjygis/wms?service=WMS&version=1.1.0&request=GetMap&layers=layername&bbox=103.804856%2C24.869804%2C109.336088%2C29.12673&width=768&height=591&srs=EPSG%3A4326&format=application/openlayers&viewparams=paramcolor:00ff00;type:A
?
?
樣式設置:
<?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"><!-- a Named Layer is the basic building block of an SLD document --><NamedLayer><Name>default_point</Name><UserStyle><!-- Styles can have names, titles and abstracts --><Title>Default Point</Title><Abstract>A sample style that draws a point</Abstract><!-- FeatureTypeStyles describe how to render different features --><!-- A FeatureTypeStyle for rendering points --><FeatureTypeStyle><Rule><Name>rule1</Name><Title>Red Square</Title><Abstract>A 6 pixel square with a red fill and no stroke</Abstract><PointSymbolizer><Graphic><Mark><WellKnownName>circle</WellKnownName><Fill><CssParameter name="fill"><ogc:PropertyName>paramcolor</ogc:PropertyName></CssParameter></Fill></Mark><Size>6</Size></Graphic></PointSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer> </StyledLayerDescriptor>視圖sql設置:
select? dataid, dataname,d.the_geom,'#%paramcolor%' as paramcolor from d
where apt_code ='%type%'
提取 paramcolor和type為動態參數
?
總結
以上是生活随笔為你收集整理的geoserver动态颜色参数样式、动态sql配置实现的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: RabbitMQ(2) 一般介绍
- 下一篇: Wireshark数据抓包分析之FTP协