GIS学习 Geoserver使用添加、删除、查询地图中的POI
在geoserver自定义的地图中通过geoserver wfs 查询,删除,添加相关的POI。
相关操作的格式如下:
查询
<wfs:GetFeature service="WFS" version="1.0.0"
outputFormat="GML2"
xmlns:opengis="http://www.cetusOpengis.com"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">
<wfs:Query typeName="opengis:qqy">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>status</ogc:PropertyName>
<ogc:Literal>0</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>;
添加
<wfs:Transaction service="WFS" version="1.0.0"
outputFormat="GML2"
xmlns:opengis="http://www.cetusOpengis.com"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">
<wfs:Insert handle="someprj1">
<opengis:someprj>
<opengis:the_geom>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#3395" >
<gml:coordinates decimal="." cs="," ts="">13404701.212,3850391.781</gml:coordinates>
</gml:Point>
</opengis:the_geom>
<opengis:ssds>13</opengis:ssds>
<opengis:qqybh>12</opengis:qqybh>
<opengis:status>0</opengis:status>
</opengis:someprj>
</wfs:Insert>
</wfs:Transaction>;
修改
<wfs:Transaction service="WFS" version="1.0.0"
outputFormat="GML2"
xmlns:opengis="http://www.cetusOpengis.com"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">
<wfs:Update typeName="opengis:qqyproject">
<wfs:Property>
<wfs:Name>qqybh</wfs:Name>
<wfs:Value>12</wfs:Value>
</wfs:Property>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>qqybh</ogc:PropertyName>
<ogc:Literal>0</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Update>
</wfs:Transaction>;
删除
<wfs:Transaction service="WFS" version="1.0.0"
outputFormat="GML2"
xmlns:opengis="http://www.cetusOpengis.com"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">
<wfs:Delete typeName="opengis:qqyproject">
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>qqybh</ogc:PropertyName>
<ogc:Literal>12</ogc:Literal>
</ogc:PropertyIsLessThan>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>qqybh</ogc:PropertyName>
<ogc:Literal>0</ogc:Literal>
</ogc:PropertyIsGreaterThan>
</ogc:Filter>
</wfs:Delete>
</wfs:Transaction>;
具体实现如下:
- package com.geoserver;
- import java.util.HashMap;
- import java.util.Map;
- import java.util.Map.Entry;
- /**
- * 操作geoserver的几种方法
- *
- *
- *
- * @Title: TODO
- * @Description: 实现TODO
- * @Copyright:Copyright (c) 2011
- * @Company:
- * @Date:2012-8-30
- * @author
- * @version 1.0
- */
- public class MainGeoService {
- public static void main(String[] args) {
- addGeoServerService();
- }
- /**
- * 添加地图定的信息
- */
- public static void addGeoServerService(){
- String layerName="loc_point";
- String namespaceValue="http://www.easyway.net.cn";
- double lat=139.54d;
- double lon=-116.23d;
- Map<String,String> params=new HashMap<String,String>();
- params.put("FID", "loc_point.4");
- params.put("NAME", "easyway_001");
- params.put("OBJECT_CODE", "beijing_tsingperk_768");
- params.put("HANDLE_ID", "768");
- params.put("STATUS", "1");
- params.put("DESCRIPTION", "this is point add by programe");
- StringBuffer sb = new StringBuffer();
- sb.append("<wfs:Transaction service='WFS' version='1.0.0' ");
- sb.append("outputFormat='GML2' ");
- sb.append(" xmlns:opengis='"+namespaceValue+"' ");
- sb.append(" xmlns:wfs='http://www.opengis.net/wfs' ");
- sb.append(" xmlns:ogc='http://www.opengis.net/ogc' ");
- sb.append(" xmlns:gml='http://www.opengis.net/gml' ");
- sb.append("xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ");
- sb.append(" xsi:schemaLocation='http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd'> ");
- sb.append(" <wfs:Insert handle='"+layerName+"'>");
- sb.append(" <opengis:"+layerName+">");
- sb.append(" <opengis:the_geom>");
- sb.append(" <gml:Point srsName='http://www.opengis.net/gml/srs/epsg.xml#3395' >");
- sb.append(" <gml:coordinates decimal='.' cs=',' ts=' '>"+lat+","+lon+"</gml:coordinates>");
- sb.append(" </gml:Point>");
- sb.append(" </opengis:the_geom>");
- if(!params.isEmpty()){
- for (Entry<String,String> entry : params.entrySet()) {
- sb.append(" <opengis:"+entry.getKey()+">"+entry.getValue()+"</opengis:"+entry.getKey()+">");
- }
- }
- sb.append(" </opengis:"+layerName+">");
- sb.append(" </wfs:Insert> ");
- sb.append(" </wfs:Transaction>");
- String response = HttpUtils.doGeoServerPOST(
- "http://10.100.108.20:8080/geoserver/wfs?outputFormat=json",
- sb.toString());
- System.out.println("response:");
- System.out.println("" + response);
- }
- /**
- * 查询地图中的访问
- * 假定我们指定的查询范围为bbox,根据上述参数设定,进行范围查询的Url为:
- * “WfsUrl?REQUEST=GetFeature&typeName= WfsNamespace : WfsLayerName &bbox=bbox&outputFormat=json”。
- * bbox是怎么来的呢?bbox实际上描绘的是一个矩形,假定矩形左下角的点是Max(x1,y1),右上角的点是Min(x2,y2),
- * 则bbox是形如“x1,y1,x2,y2”的一个字符串。
- */
- public static void queryRangeGeoServerService() {
- //空间
- String namespace="jacob";
- //图层名称
- String layerName="loc_point";
- double minX=40.34d;
- double minY=65.344d;
- double maxX=45.34d;
- double maxY=67.34d;
- String queryRangeURL="http://10.100.108.20:8080/geoserver/wfs?REQUEST=GetFeature&typeName="+namespace+":"+layerName+"&bbox="+minX+","+minY+","+maxX+","+maxY+"&outputFormat=json";
- String response = HttpUtils.doGeoServerPOST(queryRangeURL,"");
- System.out.println("response:");
- System.out.println("" + response);
- }
- /**
- * 查询名称为cesuo 的地方
- *
- */
- public static void queryGeoServerService() {
- String namespace="jacob";
- String namespaceValue="http://www.easyway.net.cn";
- String layerName="loc_point";
- Map<String,String> params=new HashMap<String,String>();
- params.put("Name", "cesuo");
- StringBuffer sb = new StringBuffer();
- sb.append("<w:GetFeature service='WFS' version='1.1.0' ");
- sb.append(" xmlns:w='http://www.opengis.net/wfs' ");
- sb.append(" xmlns:f='"+namespaceValue+"' ");
- sb.append(" xmlns:g='http://www.opengis.net/gml' ");
- sb.append(" xmlns:o='http://www.opengis.net/ogc' ");
- sb.append(" x:schemaLocation='http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd WfsUrl/DescribeFeatureType?version=1.1.0&typename="+namespace+":"+layerName+"' ");
- sb.append(" xmlns:x='http://www.w3.org/2001/XMLSchema-instance'>");
- sb.append(" <w:Query typeName='f:"+layerName+"'>");
- sb.append(" <o:Filter>");
- sb.append(" <o:PropertyIsEqualTo>");
- if(!params.isEmpty()){
- for (Entry<String,String> entry : params.entrySet()) {
- sb.append(" <o:PropertyName>f:"+entry.getKey()+"</o:PropertyName>");
- sb.append(" <o:Literal>"+entry.getValue()+"</o:Literal>");
- }
- }
- sb.append(" </o:PropertyIsEqualTo>");
- sb.append(" </o:Filter>");
- sb.append(" </w:Query>");
- sb.append("</w:GetFeature>");
- String response = HttpUtils.doGeoServerPOST(
- "http://10.100.108.20:8080/geoserver/wfs?outputFormat=json",
- sb.toString());
- System.out.println("response:");
- System.out.println("" + response);
- }
- /**
- *
- * 假定我们要删除的STATE_NAME为北京的点,则根据上述参数设定,此查询的url为:WfsUrl,
- * 同时需要将如下形式的参数信息,提交到服务器。如以post的方式,
- * 将参数信息写入HttpWebRequest的RequestStream中。
- *
- */
- public static void deletePointGeoServerService() {
- String namespace="jacob";
- String namespaceValue="http://www.easyway.net.cn";
- String layerName="loc_point";
- Map<String,String> params=new HashMap<String,String>();
- params.put("Name", "cesuo");
- StringBuffer sb = new StringBuffer();
- sb.append("<w:Transaction xmlns:w='http://www.opengis.net/wfs' ");
- sb.append(" xmlns:f='"+namespaceValue+"' xmlns:g='http://www.opengis.net/gml' ");
- sb.append(" service='WFS' version='1.1.0' xmlns:o='http://www.opengis.net/ogc' ");
- sb.append(" x:schemaLocation='http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd WfsUrl /DescribeFeatureType?version=1.1.0&typename="+namespace+":"+layerName+" ' xmlns:x='http://www.w3.org/2001/XMLSchema-instance'>");
- sb.append(" <w:Delete typeName='f:"+layerName+"'>");
- sb.append(" <o:Filter>");
- sb.append(" <o:PropertyIsEqualTo>");
- if(!params.isEmpty()){
- for (Entry<String,String> entry : params.entrySet()) {
- sb.append(" <o:PropertyName>f:"+entry.getKey()+"</o:PropertyName>");
- sb.append(" <o:Literal>"+entry.getValue()+"</o:Literal>");
- }
- }
- sb.append(" </o:PropertyIsEqualTo>");
- sb.append(" </o:Filter>");
- sb.append(" </w:Delete>");
- sb.append(" </w:Transaction>");
- String response = HttpUtils.doGeoServerPOST(
- "http://10.100.108.20:8080/geoserver/wfs?outputFormat=json",
- sb.toString());
- System.out.println("response:");
- System.out.println("" + response);
- }
- }
package com.geoserver; import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry; /**
* 操作geoserver的几种方法
*
*
*
* @Title: TODO
* @Description: 实现TODO
* @Copyright:Copyright (c) 2011
* @Company:
* @Date:2012-8-30
* @author
* @version 1.0
*/
public class MainGeoService { public static void main(String[] args) {
addGeoServerService(); }
/**
* 添加地图定的信息
*/
public static void addGeoServerService(){
String layerName="loc_point";
String namespaceValue="http://www.easyway.net.cn";
double lat=139.54d;
double lon=-116.23d; Map<String,String> params=new HashMap<String,String>();
params.put("FID", "loc_point.4");
params.put("NAME", "easyway_001");
params.put("OBJECT_CODE", "beijing_tsingperk_768");
params.put("HANDLE_ID", "768");
params.put("STATUS", "1");
params.put("DESCRIPTION", "this is point add by programe"); StringBuffer sb = new StringBuffer();
sb.append("<wfs:Transaction service='WFS' version='1.0.0' ");
sb.append("outputFormat='GML2' ");
sb.append(" xmlns:opengis='"+namespaceValue+"' ");
sb.append(" xmlns:wfs='http://www.opengis.net/wfs' ");
sb.append(" xmlns:ogc='http://www.opengis.net/ogc' ");
sb.append(" xmlns:gml='http://www.opengis.net/gml' ");
sb.append("xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ");
sb.append(" xsi:schemaLocation='http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd'> ");
sb.append(" <wfs:Insert handle='"+layerName+"'>");
sb.append(" <opengis:"+layerName+">");
sb.append(" <opengis:the_geom>");
sb.append(" <gml:Point srsName='http://www.opengis.net/gml/srs/epsg.xml#3395' >");
sb.append(" <gml:coordinates decimal='.' cs=',' ts=' '>"+lat+","+lon+"</gml:coordinates>");
sb.append(" </gml:Point>");
sb.append(" </opengis:the_geom>"); if(!params.isEmpty()){
for (Entry<String,String> entry : params.entrySet()) {
sb.append(" <opengis:"+entry.getKey()+">"+entry.getValue()+"</opengis:"+entry.getKey()+">");
}
}
sb.append(" </opengis:"+layerName+">");
sb.append(" </wfs:Insert> ");
sb.append(" </wfs:Transaction>");
String response = HttpUtils.doGeoServerPOST(
"http://10.100.108.20:8080/geoserver/wfs?outputFormat=json",
sb.toString());
System.out.println("response:");
System.out.println("" + response);
}
/**
* 查询地图中的访问
* 假定我们指定的查询范围为bbox,根据上述参数设定,进行范围查询的Url为:
* “WfsUrl?REQUEST=GetFeature&typeName= WfsNamespace : WfsLayerName &bbox=bbox&outputFormat=json”。
* bbox是怎么来的呢?bbox实际上描绘的是一个矩形,假定矩形左下角的点是Max(x1,y1),右上角的点是Min(x2,y2),
* 则bbox是形如“x1,y1,x2,y2”的一个字符串。
*/
public static void queryRangeGeoServerService() {
//空间
String namespace="jacob";
//图层名称
String layerName="loc_point"; double minX=40.34d;
double minY=65.344d;
double maxX=45.34d;
double maxY=67.34d; String queryRangeURL="http://10.100.108.20:8080/geoserver/wfs?REQUEST=GetFeature&typeName="+namespace+":"+layerName+"&bbox="+minX+","+minY+","+maxX+","+maxY+"&outputFormat=json";
String response = HttpUtils.doGeoServerPOST(queryRangeURL,"");
System.out.println("response:");
System.out.println("" + response);
}
/**
* 查询名称为cesuo 的地方
*
*/
public static void queryGeoServerService() {
String namespace="jacob";
String namespaceValue="http://www.easyway.net.cn";
String layerName="loc_point";
Map<String,String> params=new HashMap<String,String>();
params.put("Name", "cesuo"); StringBuffer sb = new StringBuffer();
sb.append("<w:GetFeature service='WFS' version='1.1.0' ");
sb.append(" xmlns:w='http://www.opengis.net/wfs' ");
sb.append(" xmlns:f='"+namespaceValue+"' ");
sb.append(" xmlns:g='http://www.opengis.net/gml' ");
sb.append(" xmlns:o='http://www.opengis.net/ogc' ");
sb.append(" x:schemaLocation='http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd WfsUrl/DescribeFeatureType?version=1.1.0&typename="+namespace+":"+layerName+"' ");
sb.append(" xmlns:x='http://www.w3.org/2001/XMLSchema-instance'>");
sb.append(" <w:Query typeName='f:"+layerName+"'>");
sb.append(" <o:Filter>");
sb.append(" <o:PropertyIsEqualTo>");
if(!params.isEmpty()){
for (Entry<String,String> entry : params.entrySet()) {
sb.append(" <o:PropertyName>f:"+entry.getKey()+"</o:PropertyName>");
sb.append(" <o:Literal>"+entry.getValue()+"</o:Literal>");
}
}
sb.append(" </o:PropertyIsEqualTo>");
sb.append(" </o:Filter>");
sb.append(" </w:Query>");
sb.append("</w:GetFeature>");
String response = HttpUtils.doGeoServerPOST(
"http://10.100.108.20:8080/geoserver/wfs?outputFormat=json",
sb.toString());
System.out.println("response:");
System.out.println("" + response);
} /**
*
* 假定我们要删除的STATE_NAME为北京的点,则根据上述参数设定,此查询的url为:WfsUrl,
* 同时需要将如下形式的参数信息,提交到服务器。如以post的方式,
* 将参数信息写入HttpWebRequest的RequestStream中。
*
*/
public static void deletePointGeoServerService() { String namespace="jacob";
String namespaceValue="http://www.easyway.net.cn";
String layerName="loc_point";
Map<String,String> params=new HashMap<String,String>();
params.put("Name", "cesuo"); StringBuffer sb = new StringBuffer();
sb.append("<w:Transaction xmlns:w='http://www.opengis.net/wfs' ");
sb.append(" xmlns:f='"+namespaceValue+"' xmlns:g='http://www.opengis.net/gml' ");
sb.append(" service='WFS' version='1.1.0' xmlns:o='http://www.opengis.net/ogc' ");
sb.append(" x:schemaLocation='http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd WfsUrl /DescribeFeatureType?version=1.1.0&typename="+namespace+":"+layerName+" ' xmlns:x='http://www.w3.org/2001/XMLSchema-instance'>");
sb.append(" <w:Delete typeName='f:"+layerName+"'>");
sb.append(" <o:Filter>");
sb.append(" <o:PropertyIsEqualTo>");
if(!params.isEmpty()){
for (Entry<String,String> entry : params.entrySet()) {
sb.append(" <o:PropertyName>f:"+entry.getKey()+"</o:PropertyName>");
sb.append(" <o:Literal>"+entry.getValue()+"</o:Literal>");
}
}
sb.append(" </o:PropertyIsEqualTo>");
sb.append(" </o:Filter>");
sb.append(" </w:Delete>");
sb.append(" </w:Transaction>");
String response = HttpUtils.doGeoServerPOST(
"http://10.100.108.20:8080/geoserver/wfs?outputFormat=json",
sb.toString());
System.out.println("response:");
System.out.println("" + response);
}
}
- package com.geoserver;
- import java.io.IOException;
- import java.io.ObjectInputStream;
- import org.apache.http.Header;
- import org.apache.http.HttpEntity;
- import org.apache.http.HttpHost;
- import org.apache.http.HttpResponse;
- import org.apache.http.client.HttpClient;
- import org.apache.http.client.methods.HttpPost;
- import org.apache.http.conn.scheme.PlainSocketFactory;
- import org.apache.http.conn.scheme.Scheme;
- import org.apache.http.conn.scheme.SchemeRegistry;
- import org.apache.http.conn.ssl.SSLSocketFactory;
- import org.apache.http.entity.StringEntity;
- import org.apache.http.impl.client.DefaultHttpClient;
- import org.apache.http.params.CoreConnectionPNames;
- import org.apache.http.util.EntityUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- /**
- *
- * @Title: TODO
- * @Description: 实现TODO
- * @Copyright:Copyright (c) 2011
- * @Company:
- * @Date:2012-8-30
- * @author
- * @version 1.0
- */
- public class HttpUtils {
- private final static Logger logger = LoggerFactory.getLogger(HttpUtils.class);
- private static final int DEFAULT_CONN_TIMEOUT_MILLISECONDS = 5 * 1000;
- private static final int DEFAULT_READ_TIMEOUT_MILLISECONDS = 60 * 1000;
- private static final String CHARSET = "utf-8";
- private static HttpClient httpClient;
- static HttpHost proxy;
- static {
- proxy = new HttpHost("10.0.0.172", 80);
- }
- private static HttpClient initHttpClient(String charset) {
- if (charset == null)
- charset = System.getProperty("sun.jnu.encoding");
- releaseConnection();
- // 设置我们的HttpClient支持HTTP和HTTPS两种模式
- SchemeRegistry schemeRegistry = new SchemeRegistry();
- schemeRegistry.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
- schemeRegistry.register(new Scheme("https", 443, SSLSocketFactory.getSocketFactory()));
- // 使用线程安全的连接管理来创建HttpClient
- /*ThreadSafeClientConnManager connectionManager = new ThreadSafeClientConnManager(schemeRegistry);
- connectionManager.setMaxTotal(DEFAULT_MAX_TOTAL_CONNECTIONS);
- connectionManager.setDefaultMaxPerRoute(DEFAULT_MAX_CONNECTIONS_PER_ROUTE);*/
- httpClient = new DefaultHttpClient();
- /*HttpParams params = httpClient.getParams();
- params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,
- DEFAULT_CONN_TIMEOUT_MILLISECONDS);
- params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,
- DEFAULT_READ_TIMEOUT_MILLISECONDS);*/
- setConnectTimeout(DEFAULT_CONN_TIMEOUT_MILLISECONDS);
- setReadTimeout(DEFAULT_READ_TIMEOUT_MILLISECONDS);
- return httpClient;
- }
- /**
- * HTTP post请求
- *
- * @param url
- * 请求地址
- * @param parmsMap
- * post数据
- * @return
- */
- public static String doGeoServerPOST(String url, String requst) {
- HttpPost httpPost = null;
- HttpResponse httpResponse = null;
- ObjectInputStream ois = null;
- try {
- if (httpClient == null)
- initHttpClient(CHARSET);
- httpPost = new HttpPost(url);
- // 绑定参数Entity
- StringEntity stringEntity = new StringEntity(requst, CHARSET);
- httpPost.setEntity(stringEntity);
- // 发送请求
- httpResponse = httpClient.execute(httpPost);
- if (httpResponse.getStatusLine().getStatusCode() == 200) {
- Header[] headers = httpResponse.getAllHeaders();
- for(Header h : headers){
- System.err.println(h.getName() + " : " + h.getValue());
- }
- HttpEntity entity = httpResponse.getEntity();
- return EntityUtils.toString(entity);
- }
- return null;
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- } finally {
- try {
- if (ois != null) {
- ois.close();
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- httpClient.getConnectionManager().shutdown();
- }
- }
- /**
- * Set the connection timeout for the underlying HttpClient. A timeout value
- * of 0 specifies an infinite timeout.
- *
- * @param timeout the timeout value in milliseconds
- */
- private static void setConnectTimeout(int timeout) {
- httpClient.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,
- timeout);
- }
- /**
- * Set the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout
- * for waiting for data or, put differently, a maximum period inactivity
- * between two consecutive data packets.A timeout value of 0 specifies an
- * infinite timeout.
- *
- * @param timeout the timeout value in milliseconds
- */
- private static void setReadTimeout(int timeout) {
- httpClient.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, timeout);
- }
- private static void releaseConnection() {
- if (httpClient != null)
- httpClient.getConnectionManager().shutdown();
- }
- }
GIS学习 Geoserver使用添加、删除、查询地图中的POI的更多相关文章
- Java web与web gis学习笔记(二)——百度地图API调用
系列链接: Java web与web gis学习笔记(一)--Tomcat环境搭建 Java web与web gis学习笔记(二)--百度地图API调用 JavaWeb和WebGIS学习笔记(三)-- ...
- php常用数组array函数实例总结【赋值,拆分,合并,计算,添加,删除,查询,判断,排序】
本文实例总结了php常用数组array函数.分享给大家供大家参考,具体如下: array_combine 功能:用一个数组的值作为新数组的键名,另一个数组的值作为新数组的值 案例: <?php ...
- windows 2003添加删除windows组件中无iis应用程序服务器项的解决方法
解决方法如下: 1.开始 -- 运行,输入 c:\Windows\inf\sysoc.inf,会打开这个文件;在sysoc.inf中找到"[Components]"这一段,并继续找 ...
- 脚本添加删除nginx配置中的内容
[root@nodejs script]# more editnginx.sh #!/bin/bash # function back_check(){ # 备份配置和覆盖配置文件 cp -rf /e ...
- 我的PHP之旅--数据库连接MySQL服务器,添加 删除 查询
PHP连接MySQL服务器 连接MySQL的方法:mysql_connect(); 语法:resource $link = mysql_connect($hostname, $username, $p ...
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
转载:http://www.cnblogs.com/kivenhou/archive/2013/02/22/2921954.html 操作List前请设置SPWeb的allowUnsafeUpdate ...
- jquery 学习(四) - 标签 添加/删除/修改
HTML代码 <div class="a1"> <div> <span id="a2">aaa</span> & ...
- Angularjs学习笔记2_添加删除DOM元素
1.调用element方法 angular.element(html) 把字符串或dom对象转化成一JQuery对象, angular.element(document.getElementB ...
- 使用command对象添加删除查询记录
private void button1_Click(object sender, EventArgs e) { //实例化数据库连接对象 SqlConnection sqlcon = new Sql ...
随机推荐
- SELinux 入门
几乎可以肯定每个人都听说过 SELinux (更准确的说,尝试关闭过),甚至某些过往的经验让您对 SELinux 产生了偏见.不过随着日益增长的 0-day 安全漏洞,或许现在是时候去了解下这个在 L ...
- JS之字符串和数组
字符串: 属性: length:可以获取字符串的长度: <script type="text/javascript"> var str = "haha&quo ...
- 本地用户 vsftpd 配置文件
# 禁止匿名用户anonymous登录 anonymous_enable=NO # 允许本地用户登录 local_enable=YES local_root=/data/wwwroot/ # 让登录的 ...
- 今日SGU 5.17
SGU 119 题意:给你一个0-15组成的4*4的矩形,问你能不能回到正常 收获:把矩形变成一维数组,然后判断当前矩形状态到目标状态(逆序对为15)逆序对和0到目标的奇偶性是否不相同,证明题,引荐大 ...
- SQL脚本存在TABLE ACCESS FULL行为
对于SQL的执行计划,一般尽量避免TABLE ACCESS FULL的出现,那怎样去定位,系统里面哪些SQL脚本存在TABLE ACCESS FULL行为,对于9i及以后版本,使用以下语句即可 sel ...
- java同步包种ArrayBlockingQueue类的分析与理解
前言: ArrayBlockingQueue类是一个堵塞队列.重要用于多线程操作的条件. 一,官方解释 一个建立在数组之上被BlockingQueue绑定的堵塞队列.这个队列元素顺序是先进先出.队列的 ...
- vim-normal多行操作命令的使用
命令行命令-<:normal>这个命令可以重复上一个操作.他其实就跟.命令的效果查不到.不同的是,他可以把.的效果,作用于你用可视模式下的多行.例如,如果你想在下面的文字里在每一行加一个; ...
- hq-源码编译
这里编译整个项目的基本格式是 ./mk + 平台名 +项目名_客户名 +mmm +new 例如 ./mk hq6735_65c_b1k_l1 al811_doov mmm new 编译单个模块 ./m ...
- go语言的一个gui 开源 项目 https://github.com/andlabs/ui
go语言的一个gui 开源 项目 https://github.com/andlabs/ui 1 安装 mingw-w64 链接地址: http://mingw-w64.sourceforge. ...
- 2017国家集训队作业[arc076d/f][Exhausted?]
2017国家集训队作业[arc076d/f][Exhausted?] 题意: 有\(N\)个人,\(M\)把椅子,给出\(...L_i.R_i\)表示第\(i\)个人可以选择编号为\(1\sim ...