关于geoserver的多边形范围查询无效的原因

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:`
        
             
                The_Geom

                
                 
                
                 
                
                
                
                116.707206,32.6651 116.705943,32.665517 116.70605,32.664144 116.707338,32.663457 116.708475,32.664723 116.707206,32.6651  
                
                  
                
                  
                
                  
                
                
            
        
        `
    }
    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,'错误');    
        }
    })
}

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

image.png

2.这里一定要写上


image.png

decimal="." //小数点
cs="," //分隔符1
ts="" //分隔符2

你可能感兴趣的:(关于geoserver的多边形范围查询无效的原因)