wfs形式从geoserver请求所有的图层数据
java代码如下(当然,正常应该是用ajax去请求数据,我这里用java代码作测试):
HttpClient hc = new HttpClient();
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair(“BBOX”,”113.493551,33.745379,124.001,38.844582″));
params.add(new BasicNameValuePair(“REQUEST”,”GetFeature”));
params.add(new BasicNameValuePair(“SERVICE”,”WFS”));
params.add(new BasicNameValuePair(“TYPENAME”,”shandong:sandong_P”));
params.add(new BasicNameValuePair(“VERSION”,”1.0.0″));
String response = hc.httpPost(ip,port,”/geoserver/shandong/wfs”, params);
这里(“TYPENAME”,”shandong:sandong_P”)中shandong:sandong_P,是要查找的图层的名字。
转载自:https://blog.csdn.net/inrtyx/article/details/20485545