問題0:geoserver下載和安裝:
參考鏈接:https://www.jianshu.com/p/6996efb94fbe,建議下載geoserver.exe安裝版本進行安裝
問題1:geoserver發佈shapefile數據
https://blog.csdn.net/qq_35732147/article/details/81127068
問題2:發佈矢量切片服務:
在geoserver官網對應的版本下載 vectortiles-plugin,將插件拷貝到E:\Program Files (x86)\GeoServer 2.15.0\webapps\geoserver\WEB-INF\lib下,重啓geoserver服務。
問題3:geoserver跨域問題:
拷貝路徑下:E:\Program Files (x86)\GeoServer 2.15.0\lib
jetty-servlet-9.4.12.v20180830.jar 、jetty-util-9.4.12.v20180830.jar 這兩個文件到
E:\Program Files (x86)\GeoServer 2.15.0\webapps\geoserver\WEB-INF\lib
配置E:\Program Files (x86)\GeoServer 2.15.0\webapps\geoserver\WEB-INF\web.xml,開啓跨域
<!-- Uncomment following filter to enable CORS-->
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
<init-param>
<param-name>chainPreflight</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>allowedOrigins</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>allowedMethods</param-name>
<param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value>
</init-param>
<init-param>
<param-name>allowedHeaders</param-name>
<param-value>*</param-value>
</init-param>
</filter>
<!-- Uncomment following filter to enable CORS -->
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
參考鏈接:https://blog.csdn.net/YOOSHIN/article/details/103712534
問題4:geoserver矢量切片地址格式
/參數設置
var baseUrl = 'http://localhost:9999';
var workspace = 'plan2';
var layerName = 'dlm';
var epsg = '900913';
var format = 'application/x-protobuf;type=mapbox-vector'; // application/vnd.mapbox-vector-tile
var vectorLayerUrl = baseUrl + "/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS" +
"&VERSION=1.0.0&LAYER=" + workspace + ":" + layerName + "&STYLE=&TILEMATRIX=EPSG:" + epsg + ":{z}" +
"&TILEMATRIXSET=EPSG:" + epsg + "&FORMAT=" + format + "&TILECOL={x}&TILEROW={y}";
// 使用 TMS 的方式
vectorLayerUrl = baseUrl + '/geoserver/gwc/service/tms/1.0.0/' + workspace + ":" + layerName +
'@EPSG%3A' + epsg + '@pbf/{z}/{x}/{y}.pbf';
問題5:修改切片存儲位置
打開”GeoServer \webapps\geoserver\WEB-INF“,打開web.xml,配置緩存地址路徑,配置完成後重啓geoserver。
<context-param>
<!-- this sets the geoserver cache dir -->
<param-name>GEOWEBCACHE_CACHE_DIR</param-name>
<param-value>D:\geoserverTitle</param-value>
</context-param>
問題6:geoserver如何發佈自定義座標系矢量瓦片服務
參考鏈接:https://www.cnblogs.com/naaoveGIS/p/8589204.html
問題7:geoserver矢量瓦片發服務前端展示偏移問題解決
問題8:數據源中數據發生變化,矢量切片需要重新發布,如何實現矢量切片的動態自動更新?
開源方案搭建離線矢量切片地圖服務:
https://www.cnblogs.com/ATtuing/p/9085312.html
https://github.com/HuHongYong/Mapbox-js-offline
geoserver矢量切片資料整理:https://www.jianshu.com/p/94eb826fc19f
python矢量切片:https://www.dazhuanlan.com/2019/08/30/5d67fd7db7a14/
postgis計算矢量切片:https://www.jianshu.com/p/ab207787c21a
https://github.com/vicapow/go-vtile-example