国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > WEB開發(fā) > 正文

GeoServer中WMS、WFS的請求規(guī)范

2024-04-27 15:10:08
字體:
供稿:網(wǎng)友

1.2WFS簡介

Web要素服務(wù)(WFS)返回的是要素級的GML編碼,并提供對要素的增加、修改、刪除等事務(wù)操作,是對Web地圖服務(wù)的進(jìn)一步深入。OGC Web要素服務(wù)允許客戶端從多個(gè)Web要素服務(wù)中取得使用地理標(biāo)記語言(GML)編碼的地理空間數(shù)據(jù),這個(gè)遠(yuǎn)東定義了五個(gè)操作:GetCapabilites返回Web要素服務(wù)性能描述文檔(用xml描述);DescribeFeatureType返回描述可以提供服務(wù)的任何要素結(jié)構(gòu)的XML文檔;GetFeature為一個(gè)獲取要素實(shí)例的請求提供服務(wù);Transaction為事務(wù)請求提供服務(wù);LockFeature處理在一個(gè)事務(wù)期間對一個(gè)或多個(gè)要素類型實(shí)例上鎖的請求。

GeoServer官網(wǎng)上對其WFS規(guī)范的描述地址為http://docs.geoserver.org/stable/en/user/services/wfs/index.html。

2.WMS請求規(guī)范詳解

2.1GetCapabitities(返回服務(wù)級元數(shù)據(jù))

URL例子:

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

參數(shù)意義:

                       

返回結(jié)果:

其返回結(jié)果為一個(gè)描述性XML文檔,包含了以下三個(gè)要素:

 

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。

參數(shù)意義:

 

這里對返回的格式(format)有如下選擇:

 

返回結(jié)果:

 

注意:此請求同樣支持XML格式請求,如下:

 

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。

參數(shù)意義:

 

 這里對返回的文本格式(info_format)有如下選擇:

 

返回結(jié)果(忽略中文亂碼):

   

 

3.WFS請求規(guī)范

3.1GetCapabilities(返回服務(wù)描述文檔)

URL例子:

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

參數(shù)意義:

 

返回結(jié)果:

返回的結(jié)果為描述性XML,包含以下五個(gè)主要部分:

 

3.2DescribeFeatureType(返回圖層描述信息)

URL例子:

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

參數(shù)意義:

 

 返回結(jié)果:

 

3.3GetFeature(獲取圖層要素)

3.3.1GET查詢

這里首先給出一個(gè)例子:

 

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。

此請求常見的參數(shù)有:typeNames,featureID,propertyName,Filter, count, sortBy。其中Filter參數(shù)最為重要,主要負(fù)責(zé)進(jìn)行選擇過濾。關(guān)于Filter的具體描述可參考:http://docs.geoserver.org/stable/en/user/filter/function.html。

 返回結(jié)果為:

 {"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":"江干區(qū)","eventtypes":null,"otherrequest":null,"limitname":"上報(bào)區(qū)域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/機(jī)票預(yù)訂.png","shape_length":null,"shape_area":null,"graphicid":318,"regionname":"江干區(qū)","eventtypes":"亂搭亂建,暴露垃圾,積存垃圾渣土,路面不潔,河道不潔(含溝渠、湖面)","otherrequest":"測試","limitname":"上報(bào)區(qū)域72"}}],"crs":{"type":"EPSG","properties":{"code":"4490"}}}

3.3.1.1點(diǎn)查詢Filter

<Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<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.3.1.2自定義多邊形查詢Filter

<Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<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.3.2Post查詢

因?yàn)镚ET請求的數(shù)據(jù)量大小在4kb以內(nèi),所以Post為更常用的方法。以下為一個(gè)具體的例子:

 

其中直接發(fā)送的為一個(gè)XML文件,其Filter中可以填寫的內(nèi)容和GET中的Filter一樣。

具體內(nèi)容如下:

<?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/wfshttp://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.4 Transaction(編輯要素)

該方法支持對要素的增刪改。這里直接給出Post請求中發(fā)送的XML組織格式:

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>

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>

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>

4.總結(jié)

a.動態(tài)出圖可以使用WMS中的GetMap請求。

b.矢量查詢可以使用WFS中的GetFeature請求。

c.要素編輯可以使用WFS中的Transaction請求。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 杭锦后旗| 安阳市| 章丘市| 缙云县| 突泉县| 虎林市| 商南县| 枣阳市| 米脂县| 牙克石市| 陵川县| 西平县| 临沭县| 金沙县| 仙居县| 鄂尔多斯市| 江源县| 海晏县| 宁晋县| 诸城市| 长泰县| 介休市| 舟曲县| 新乡县| 太原市| 锡林郭勒盟| 谢通门县| 武冈市| 固原市| 孝义市| 乐亭县| 濉溪县| 泉州市| 揭东县| 荥经县| 益阳市| 皋兰县| 香河县| 贵港市| 夏邑县| 安塞县|