1.1WMS简介

Web地图服务(WMS)利用所有地理空间地方信息的数量制作地图。其元帅地图定义为地理数据可视的变现。这一个标准定义了七个操作:GetCapabitities重回服务级元数据,它是对劳动音讯内容和须求参数的一种描述;
GetMap重临一个地图映像,其地理空间参考和大小参数是了然定义了的;GetFeatureInfo(可选)再次来到显示在地形图上的一点特殊要素的新闻。

GeoServer官网上对其WMS规范的讲述地址为http://docs.geoserver.org/stable/en/user/services/wms/index.html

小说版权由小编李晓晖和天涯论坛共有,若转发请于分明处标明出处:http://www.cnblogs.com/naaoveGIS/

2.1GetCapabitities(重临服务级元数据)

URL例子:

http://localhost:8680/geoserver/wms?service=wms&version=1.1.1&request=GetCapabilities

参数意义:

 json 1                      

重临结果:

其回来结果为一个描述性XML文档,包涵了以下多个要素:

json 2 

2.3GetFeatureInfo(重返要素音讯)

URL例子:

http://localhost:8680/geoserver/urbanlayer/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se\_xml&BBOX=10008053.503544%2C5274522.857823%2C10039584.01305%2C5292493.614536&SERVICE=WMS&INFO\_FORMAT=text/plain&QUERY\_LAYERS=urbanlayer%3ADIJI&FEATURE\_COUNT=50&Layers=urbanlayer%3ADIJI&WIDTH=579&HEIGHT=330&format=image%2Fpng&styles=&srs=EPSG%3A3857&version=1.1.1&x=315&y=147

参数意义:

 json 3

 那里对回到的文本格式(info_format)有如下采纳:

 json 4

回去结果(忽略汉语乱码):

 json 5  

 

3.4 Transaction(编辑要素)

该办法匡助对要素的增删改。这里直接交给Post请求中发送的XML社团格式:

4.总结

a.动态出图可以动用WMS中的GetMap请求。

b.矢量查询可以使用WFS中的GetFeature请求。

c.要素编辑可以选拔WFS中的Transaction请求。

                                                                   
 —–欢迎转载,但保留版权,请于显然处标明出处:http://www.cnblogs.com/naaoveGIS/

                                                                          
即使你认为本文确实扶助了您,可以微信扫一扫,举行小额的打赏和鼓励,谢谢
^_^

                                      json 6

3.3.2Post查询

因为GET请求的数据量大小在4kb以内,所以Post为更常用的主意。以下为一个现实的例证:

json 7 

其中直接发送的为一个XML文件,其Filter中可以填充的内容和GET中的Filter一样。

具体内容如下:

<?xml version=’1.0′ encoding=’GBK’?><wfs:GetFeature
service=’WFS’ version=’1.0.0′ outputFormat=’JSON’

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=’cell’>

<wfs:PropertyName>the_geom</wfs:PropertyName>

<wfs:PropertyName>test1</wfs:PropertyName>

<ogc:Filter>

<Or>

<PropertyIsEqualTo><PropertyName>test1</PropertyName><Literal>valuetest1</Literal></PropertyIsEqualTo>

<PropertyIsEqualTo><PropertyName>test2</PropertyName><Literal>valuetest2</Literal></PropertyIsEqualTo>

</Or>

</ogc:Filter>

</wfs:Query>

</wfs:GetFeature>

3.3.1GET查询

那里首先付诸一个例子:

 json 8

http://localhost:8080/eGovaGISV14//home/gis/proxy.htm?http://192.168.101.14/geoserver/urbanlayer/wfs?request=GetFeature&version=1.1.0&typename=jianfudanhistory&Filter=%3CFilter%20xmlns:ogc=%22http://www.opengis.net/ogc%22%20xmlns:gml=%22http://www.opengis.net/gml%22%3E%3CIntersects%3E%20%3CPropertyName%3Ethe\_geom%3C/PropertyName%3E%20%3Cgml:Envelope%20srsName=%22EPSG:4326%22%3E%09%20%3Cgml:lowerCorner%3E120.1762573834964%2030.280899047851562%3C/gml:lowerCorner%3E%20%09%20%3Cgml:upperCorner%3E120.18999029365265%2030.294631958007812%3C/gml:upperCorner%3E%20%3C/gml:Envelope%3E%3C/Intersects%3E%3C/Filter%3E&outputformat=json

此恳请常见的参数有:typeNames,featureID,propertyName,Filter, count,
sortBy。其中Filter参数最为重大,主要担负举办抉择过滤。关于Filter的具体讲述可参考:http://docs.geoserver.org/stable/en/user/filter/function.html

 重临结果为:

 {“type”:”FeatureCollection”,”features”:[{“type”:”Feature”,”id”:”jianfudan.322″,”geometry”:{“type”:”MultiPolygon”,”coordinates”:[[[[30.276436000822056,120.20021],[30.275750000822033,120.20021],[30.22768400082126,120.22562],[30.245537000821543,120.17343000000001],[30.276436000822056,120.20021]]]]},”geometry_name”:”the_geom”,”properties”:{“limitid”:71,”displayorder”:null,”regionid”:3,”validfromdate”:”2016-05-15Z”,”validtodate”:”2016-06-14Z”,”validflag”:1,”media”:null,”shape_length”:null,”shape_area”:null,”graphicid”:322,”regionname”:”滨江区”,”eventtypes”:null,”otherrequest”:null,”limitname”:”上报区域71″}},{“type”:”Feature”,”id”:”jianfudan.318″,”geometry”:{“type”:”MultiPolygon”,”coordinates”:[[[[30.26407600082185,120.19668600000001],[30.26407600082185,120.196434],[30.262875000821833,120.20785],[30.24708200082157,120.203896],[30.255150000821704,120.187164],[30.26407600082185,120.19668600000001]]]]},”geometry_name”:”the_geom”,”properties”:{“limitid”:72,”displayorder”:null,”regionid”:3,”validfromdate”:”2016-05-04Z”,”validtodate”:”2016-06-03Z”,”validflag”:1,”media”:”http://172.18.6.197:8081/MediaRoot/null/20160505/72/84989ee1-9bab-4640-8f24-4a7381f1c4e8/机票预订.png","shape\_length":null,"shape\_area":null,"graphicid":318,"regionname":"江干区","eventtypes":"乱搭乱建,暴露垃圾,积存垃圾渣土,路面不洁,河道不洁(含沟渠、湖面)","otherrequest":"测试","limitname":"上报区域72"}}\],"crs":{"type":"EPSG","properties":{"code":"4490"}}}

1.2WFS简介

Web要素服务(WFS)再次来到的是要素级的GML编码,并提供对要素的加码、修改、删除等作业操作,是对Web地图服务的更是深入。OGC
Web要素服务允许客户端从五个Web要素服务中取得使用地理标志语言(GML)编码的地理空间数据,那几个远东定义了八个操作:GetCapabilites再次来到Web要素服务属性描述文档(用XML描述);DescribeFeatureType重回描述可以提供劳动的其余因素结构的XML文档;GetFeature为一个收获要素实例的呼吁提供劳务;Transaction为业务请求提供劳务;LockFeature处理在一个事务时期对一个或多少个因素类型实例上锁的哀告。

GeoServer官网上对其WFS规范的叙述地址为http://docs.geoserver.org/stable/en/user/services/wfs/index.html

3.3.1.2自定义多边形查询Filter

<Filter xmlns:ogc=”http://www.opengis.net/ogc” xmlns:gml=”http://www.opengis.net/gml"&gt;

<Intersects> 

<PropertyName>the_geom</PropertyName>

<gml:MultiPolygon srsName=”EPSG:4326″> 

<gml:polygonMember> 

<gml:Polygon> 

<gml:outerBoundaryIs> 

<gml:LinearRing>

<gml:coordinates xmlns:gml=”http://www.opengis.net/gml” decimal=”.” cs=”,” ts=””>

120.15677,30.2557 120.15677,30.26351 120.16833,30.26351 120.16833,30.2557 120.15677,30.2557

</gml:coordinates>  

</gml:LinearRing>  

</gml:outerBoundaryIs>  

</gml:Polygon>  

</gml:polygonMember>  

</gml:MultiPolygon>

</Intersects>

</Filter>

 

3.4.2改动要素

<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>

1.背景

3.3.1.1点查询Filter

<Filter xmlns:ogc=”http://www.opengis.net/ogc
xmlns:gml=”http://www.opengis.net/gml"&gt;

<Intersects>

<PropertyName>the_geom</PropertyName>

<gml:Envelope srsName=”EPSG:4326″>     

<gml:lowerCorner>120.15336460382575
30.2743621901609</gml:lowerCorner>

<gml:upperCorner>120.167097513982
30.28809510031715</gml:upperCorner>

</gml:Envelope>

</Intersects>

</Filter>

3.2DescribeFeatureType(重返图层描述消息)

URL例子:

http://localhost:8680/geoserver/urbanlayer/ows?service=wfs&version=1.0.0&request=DescribeFeatureType&typeName=DIJI

参数意义:

 json 9

 重临结果:

 json 10

3.1GetCapabilities(重返服务描述文档)

URL例子:

http://localhost:8680/geoserver/wfs?service=wfs&version=1.1.0&request=GetCapabilities

参数意义:

 json 11

回来结果:

回到的结果为描述性XML,包括以下多少个根本部分:

 json 12

2.WMS呼吁规范详解

3.WFS伸手规范

3.3GetFeature(获取图层要素)

3.4.3去除要素

<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>

3.4.1添加要素

<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>

2.2GetMap(获取印象)

URL例子:

http://localhost:8680/geoserver/urbanlayer/wms?LAYERS=urbanlayer%3ADIJI&STYLES=&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A3857&BBOX=10008053.503544,5274522.8578226,10039584.01305,5292493.614536&WIDTH=579&HEIGHT=330

参数意义:

json 13 

此地对回到的格式(format)有如下选拔:

 json 14

回到结果:

 json 15

小心:此呼吁同样帮衬XML格式请求,如下:

 json 16

相关文章

网站地图xml地图