關(guān)于geoserver的多邊形范圍查詢(xún)無(wú)效的原因

function getLocationByWfsPolygon(layerName,func,bBox){
    var _this = this
    var href = window.location.href.split("/")[2]
    var sql = "1=1"
        ,typeName = 'xatree:' + layerName
        //,url = wfsUrl 
        ,url = 'https://web.skyimin.com/geoserver/xatree/ows/'
        ,cql = 'cql_filter=' + sql
    console.log(bBox)
    var params={
        service:'WFS',
        version:'1.0.0',
        request:'GetFeature',
        typeName:typeName,
        outputFormat:'application/json',
        //cql_filter:sql,
        maxFeatures:"50",
        filter:`
        <Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
            <Intersects> 
                <PropertyName>The_Geom</PropertyName>

                
                <gml:Polygon  srsName="EPSG:4326"> 
                
                <gml:outerBoundaryIs> 
                
                <gml:LinearRing>
                
                <gml:coordinates xmlns:gml="http://www.opengis.net/gml"  decimal="." cs="," ts="">116.707206,32.6651 116.705943,32.665517 116.70605,32.664144 116.707338,32.663457 116.708475,32.664723 116.707206,32.6651</gml:coordinates>  
                
                </gml:LinearRing>  
                
                </gml:outerBoundaryIs>  
                
                </gml:Polygon>  
                
                
            </Intersects>
        </Filter>
        `
    }
    var u = url + L.Util.getParamString(params, url)
    console.log(u)
    $.ajax({
        url:u,
        type:"get",
        contentType: 'application/json',
        success: function(res){
            console.log(res)
            if(func) func(res)
        },
        error:function(err){
            console.log(err,'錯(cuò)誤');    
        }
    })
}

1.要注意的是,這里一定得是1.0.0不能是1.1.0,我就是在這里被坑了

image.png

2.這里一定要寫(xiě)上


image.png

decimal="." //小數(shù)點(diǎn)
cs="," //分隔符1
ts="" //分隔符2

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Oracle to_char函數(shù)的功能是將數(shù)值型或者日期型轉(zhuǎn)化為字符型,下面就為您詳細(xì)介紹Oracle to_ch...
    木棍兒閱讀 6,157評(píng)論 0 0
  • MySQL基礎(chǔ)操作 創(chuàng)建數(shù)據(jù)庫(kù) 創(chuàng)建數(shù)據(jù)庫(kù),該命令的作用: 如果數(shù)據(jù)庫(kù)不存在則創(chuàng)建,存在則不創(chuàng)建。 創(chuàng)建RUNOO...
    少年_323a閱讀 861評(píng)論 0 0
  • pyspark.sql module Module context Spark SQL和DataFrames中的重...
    盜夢(mèng)者_(dá)56f2閱讀 5,675評(píng)論 0 19
  • MySQL基礎(chǔ)必知必會(huì) 什么是數(shù)據(jù)庫(kù)? 數(shù)據(jù)庫(kù)(Database)是按照數(shù)據(jù)結(jié)構(gòu)來(lái)組織、存儲(chǔ)和管理數(shù)據(jù)的倉(cāng)庫(kù)。 每...
    卡斯特梅的雨傘閱讀 665評(píng)論 0 1
  • 推薦指數(shù): 6.0 書(shū)籍主旨關(guān)鍵詞:特權(quán)、焦點(diǎn)、注意力、語(yǔ)言聯(lián)想、情景聯(lián)想 觀點(diǎn): 1.統(tǒng)計(jì)學(xué)現(xiàn)在叫數(shù)據(jù)分析,社會(huì)...
    Jenaral閱讀 5,982評(píng)論 0 5

友情鏈接更多精彩內(nèi)容