geowebCache 切片不同方式的调用

打印 上一主题 下一主题

主题 912|帖子 912|积分 2736

1.curl 方式
  1. curl -v -u admin:geoserver -H "Content-type: application/json" -d "{'seedRequest':{'name':'NR:tdbp','bounds':{'coords':{ 'double':[ '108.79060363769531','34.31073760986328','109.39276885986328','34.73097610473633']}},'srs':{'number':4326},'zoomStart':1,'zoomStop':12,'format':'image\/png','type':'reseed','threadCount':4}}}"  "http://127.0.0.1:8055/geoserver/gwc/rest/seed/NR:tdbp.json"<br><br><strong>2.postMan http请求<br></strong>
复制代码

 3.java 后端调用
  1. public static boolean slice(String layer, int zoomStart, int zoomStop) {<br>    int threadCount = 2;<br>    String res = "";<br>    /*String cmd = "curl  -u " + geoUsername + ":" + geoPassword + " -XPOST -H "Content-type: text/xml" -d '<seedRequest><name>" + layer +<br>            "</name><srs><number>4326</number></srs><zoomStart>" + zoomStart + "</zoomStart><zoomStop>" + zoomStop + "</zoomStop><format>image/png</format><type>" + layer + "</type><threadCount>" + threadCount + "</threadCount></seedRequest>'  ""<br>            + url + "/gwc/rest/seed/" + layer + ".xml"";*/<br>    String cmd = "curl  -u " + geoUsername + ":" + geoPassword + " -XPOST -H "Content-type: text/xml" -d '<seedRequest><name>" + layer +<br>            "</name><srs><number>900913</number></srs><zoomStart>" + zoomStart + "</zoomStart><zoomStop>" + zoomStop + "</zoomStop><format>application/vnd.mapbox-vector-tile</format><type>reseed</type><threadCount>" + threadCount + "</threadCount></seedRequest>'  ""<br>            + url + "/gwc/rest/seed/" + layer + ".xml"";<br>    HttpResponse curl = curl(cmd);<br>    StatusLine statusLine = curl.getStatusLine();<br>    return "HTTP/1.1 200 ".equals(statusLine.toString());<br>}
复制代码
 
  1.  
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

卖不甜枣

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表