GeoWebCache是切片服务器。它作为地图客户端和地图服务器之间的代理运行,在请求时缓存(存储)切片,从而消除了多余的请求处理,从而节省了大量的处理时间。尽管GeoWebCache也可以作为独立产品与其他地图服务器一起使用,但它与GeoServer集成在一起。
Java使用curl命令去调用GeoWebCache接口
- 使用springboot项目
需要引用的maven,用于执行curl命令
<dependency> <groupId>org.toile-libre.libegroupId> <artifactId>curlartifactId> <version>LATESTversion>dependency>
application.yml中的配置
geoserver: url: http://localhost:8080/geoserver username: admin password: geoserver shpworkspace: shp imageworkspace: image
java核心代码
import net.sf.json.JSONArray;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.StatusLine;import org.apache.http.util.EntityUtils;import org.springframework.beans.factory.annotation.Value;import org.springframework.stereotype.Component;import java.io.IOException;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;import static org.toilelibre.libe.curl.Curl.curl;import stat