GeoServer发布ArcgisServer切片,GeoWebCache插件。
针对geoserver2.9,后期版本经常出问题,还没深入研究
1.安装geoserver,jdk选择1.8版本,不安装为服务(出问题找问题比较费劲)
2.解压geowebcache到geoserver安装目录下webapp下
3.启动geoserver,自动生成配置文件geowebcache.xml
4.配置切片,修改Layers节点
<arcgisLayer>
<name>china</name>
<tilingScheme>D:\SGDownload\bdmap\中国_ArcGISServer瓦片\Conf.xml</tilingScheme>
<tileCachePath>D:\SGDownload\bdmap\中国_ArcGISServer瓦片\_alllayers</tileCachePath>
<hexZoom>false</hexZoom>
</arcgisLayer>
5.修改切片配置文件
conf.cdi只保留EnvelopeN节点
conf.xml,删除LatestWKID、LeftLongitude、PreciseDPI三个节点
6.重启geoserver,访问geoserver地址加端口号:http://localhost:8080/geowebcache/home
点击list,配置的图层在这了,点击png可以预览了
如果没有,点击reloadconfigration.重新读取配置文件就会有了,
默认用户名密码:geowebcache secured
7.openlayers加载切片方法同wms切片类似
var lambert = new ol.layer.Tile({
source: new ol.source.TileWMS({
url: geoserverUrl1,
params: {//
'LAYERS': 'lambert',
'FORMAT': 'image/png',
'SRS': 'EPSG:102027'
'VERSION':'1.1.1',//不要省略
// 'BBOX': [-3.4230685214206114E7, -2.6567989353681814E7, 3.423201843753554E7, 2.472132820368224E7]
},
tileGrid: new ol.tilegrid.TileGrid({//切片config.xml里面有
resolutions: [132291.93125052919, 66145.965625264595, 33072.982812632297, 16933.367200067736, 8466.6836000338681, 4233.341800016934, 2116.670900008467, 1058.3354500042335],
origin: [-34230800, 900693357774.099],
tileSize: [256, 256]
}),
}),
projection: 'EPSG:102027'
})
tips:此时geoserver会出现不能使用,目前只为发布arcgisserver切片配置的geoserver。可以安装最新的geoserver单独使用
软件(geoserver2.9,geowebcache)下载地址:链接:https://pan.baidu.com/s/1K0oGLv4E6qwpCRM-D7TyTw 密码:yun3