/**
* wmts服务
* @param params
*/
@Override
public void wmts(GeoEntityWmtsParams params) throws IOException, ServiceException, FactoryException {
HttpServletResponse response = ServletUtils.getResponse();
// 创建时间格式化对象,指定时间格式
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");
String layerName = params.getLayer();
String srs = params.getTilematrixset();
//列 == x
Integer tilecol = params.getTilecol();
//行 == y
Integer tilerow = params.getTilerow();
String version = params.getVersion();
String format = params.getFormat();
//放大倍数
Integer zoomLevel = params.getTilematrix();
String tileMatrixSet = params.getTilematrixset();
URL url = null;
try {
url = new URL("http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetCapabilities");
} catch (MalformedURLException e) {
// will not happen
}
WebMapTileServer wmts = new WebMapTileServer(url);
WMTSCapabilities capabilities = wmts.getCapabilities();
WMTSLayer layer = capabilities.getLayer(layerName);
CoordinateReferenceSystem crs = CRS.decode(srs);
// Find the TileMatrixSet for the specified zoom level
TileMatrixSet matrixSet = wmts.getCapabilities().getMatrixSet(tileMatrixSet);
geotools实现wmts服务
于 2023-07-19 10:44:24 首次发布