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"?>

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 -->

default_point

<!-- Styles can have names, titles and abstracts -->

Default Point

A sample style that draws a point

<!-- FeatureTypeStyles describe how to render different features -->

<!-- A FeatureTypeStyle for rendering points -->

rule1

Red Square

A 6 pixel square with a red fill and no stroke

circle

paramcolor

6

视图sql设置:

select  dataid, dataname,d.the_geom,'#%paramcolor%' as paramcolor from d

where apt_code ='%type%'

提取 paramcolor和type为动态参数

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容