geoserver
是一个java web gis服务器,可以用来发布图层。本篇文章只介绍如何通过geoserver
进行矢量切图。
矢量切图
-
登录本地安装的geoserver
登录地址:http://localhost:8080/geoserver/
默认的用户名/密码:admin/geoserver
-
创建gridset
由于我前端使用leaflet
,leaflet
默认使用EPSG:3857
坐标系,所以要在先创建一个EPSG:3857
的GridSet
创建gridset


点击保存即创建成功
- 上传矢量数据


这里我的数据类型是shape文件






进入Tile Layers
页面,就能看到刚刚发布的图层

选择不同的格式可以预览图层

- 切图

进入切图界面

点击提交,就可以切图了

- 切图数据
切图完成以后,就可以在其路径下查看切图后的数据
windows
下默认的路径是:C:\Users${user}\AppData\Local\Temp\geowebcache
切图后的数据
至此,切图工作完成,下一步通过leaflet进行展示矢量切片
- 使用矢量切片
-
查找此切片对应url
切片url前缀
切片url前缀
这就是切片的url前缀
使用方式为:
http://localhost:8080/geoserver/gwc/service/tms/1.0.0/cite%3Acgi@3857@pbf/{z}/{x}/{-y}.pbf
网友评论