前几天群里有人问开源技术实现等值面,之前找到相关资料,geoserver和acidmaps插件能够实现https://github.com/XoomCode/AcidMaps可以看到下边有插件部署方法。(需要注意的是geoserver2.4版本后类进行了修改,无法实现)
1. 下载jni.dll,geoserver后台使用这个接口,可以轻松实现java对动态链接库Dynamic Link Library(dll)文件的调用,以实现一些C/C++的功能(需要注意的是要把dll加到环境变量path里)
2. 下载acidmap插件,把jar包放到geoserver\WEB-INF\lib目录下
3. 启动geoserver,浏览器打开以下地址 http://localhost:8080/geoserver/wms?service=AMS&version=1.1.0&request=GetMap&layers=sf:bugsites&styles=&bbox=590223.4382724703,4914107.882513998,608462.4604629107,4920523.89081033&width=938&height=330&srs=EPSG:26713&format=image/png&VALUE_COLUMN=cat&SIMPLIFY_METHOD=3&SIMPLIFY_SIZE=90&INTERVALS[]=10,20,45,70,100&INTERVALS_COLORS[]=0xffffff80,0xff000080,0xffff0080,0x00ff0080,0x0000ff80&RENDERER_TYPE=2&INTERPOLATION_STRATEGY=2&radius=40
4.INTERPOLATION_STRATEGY可以设置0-3
enum InterpolationStrategy { DUMMY = 0, /// No interpolation uses the assigned value NEAREST_NEIGHBOR = 1, /// N Neighbors found LINEAR = 2, /// Value decays with distance INVERSE_DISTANCE_WEIGHTING = 3 /// Simple implementation of IDW };
5.SimplifyMethod设置0-3
enum SimplifyMethod { COPY = 0, /// Copy the first values GRID = 1, /// Uniform distributed grid SAMPLING = 2, /// Random samples EXTREMES = 3 /// Highest and lowest values };
6.RENDERER_TYPE设置0-2
enum RendererType { DENSE = 0, /// Intervals are indexed SPARSE = 1, /// Finds the right interval with a b-tree GRADIENT = 2 /// Smooth color rendering };
acidmaps是插值后生成图片作为wms服务发布,客户端可以通过wms服务来请求调用。