如何在geoserver中生成mbtile?使用 openlayers 显示 geoserver 层
例如像这样调用wms层
new OpenLayers.Layer.WMS("Kanpur", "http://localhost:8080/geoserver/wms", {
LAYERS: 'sample_data_old:sample',
STYLES: '',
format: 'image/jpeg',
tiled: false,
transparent: true,
tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom,
visibility:false
}, {
isBaseLayer: true
}
);
如何调用 wps 图层来创建 mbtile?
我的问题请参考此链接
http://docs.geoserver.org/stable/en/user/community/mbtiles/output.html http://docs.geoserver.org/stable/en/user/community/mbtiles/output.html
我在尝试实现与 @renjith 相同的输出时遇到了这个问题
所以,这就是我使用 GeoServer 2.19.4 生成 MBTiles 所做的事情
Steps:
- 通过安装GDAL插件在GeoServer上启用GDAL本机库,请参考此链接:GeoServer-gdal https://docs.geoserver.org/stable/en/user/data/raster/gdal.html
- 通过安装WPS插件在GeoServer上启用WPS,参考此链接:地理服务器WPS https://docs.geoserver.org/latest/en/user/services/wps/install.html
- 通过安装MBTiles源/插件来启用GeoServer上的MBTiles读/写,请参考此链接:地理服务器MBTiles https://docs.geoserver.org/stable/en/user/community/mbtiles/installing.html
确保插件版本与您的 GeoServer 实例版本匹配!
成功安装上述要求后,您应该能够生成数据源的 MBTiles。
使用 WPS 请求您的服务器
<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.opengis.net/wps/1.0.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:wps="http://www.opengis.net/wps/1.0.0"
xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:wcs="http://www.opengis.net/wcs/1.1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
<ows:Identifier>gs:MBTiles</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>layers</ows:Identifier>
<wps:Data>
<wps:LiteralData>layerName</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>format</ows:Identifier>
<wps:Data>
<wps:LiteralData>imageFormat</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>boundingbox</ows:Identifier>
<wps:Data>
<wps:BoundingBoxData crs="layerCRS" dimensions="2">
<ows:LowerCorner>MinX MinY</ows:LowerCorner>
<ows:UpperCorner>MaxX MaxY</ows:UpperCorner>
</wps:BoundingBoxData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>filename</ows:Identifier>
<wps:Data>
<wps:LiteralData>fileName</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>minZoom</ows:Identifier>
<wps:Data>
<wps:LiteralData>minZoom</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>maxZoom</ows:Identifier>
<wps:Data>
<wps:LiteralData>maxZoom</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:RawDataOutput>
<ows:Identifier>outputFormat</ows:Identifier>
</wps:RawDataOutput>
</wps:ResponseForm>
</wps:Execute>
确保替换每个输入以满足您的需求!
- 图层名称 ==> 工作空间:图层
- 图像格式 ==> png 或 jpeg
- MinX MinY ==> 空格分隔值
- MaxX MaxY ==> 空格分隔值
- fileName ==> 输出文件名
- minZoom ==> 最小缩放级别(含)
- maxZoom ==> 最大缩放级别独占(如果值为 20,则只会生成 19 个缩放级别)
- 输出格式 ==> mbtiles
如果地图服务受到保护,此请求可能需要基本身份验证,并将返回可供下载的可用生成文件的 URL!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)