首页 文章

如何在多边形很小的情况下在wms图层中获取精确的featureinfo Geoserver?

提问于
浏览
2

我获得了点击多边形特征信息的邻居多边形特征信息 .
在我的代码中:

getfeaturenfo :function(e) {

            coordinates=e;
            var params = {
                        REQUEST: "GetFeatureInfo",
                        projection: "EPSG:4326",
                        EXCEPTIONS: "application/vnd.ogc.se_xml",
                        BBOX: map.getExtent().toBBOX(),
                        SERVICE: "WMS",
                        INFO_FORMAT: 'text/html',
                        QUERY_LAYERS: selectlayer(map.zoom),
                        FEATURE_COUNT: 50,
                        Layers: selectlayer(map.zoom),
                        WIDTH: map.size.w,
                        HEIGHT: map.size.h,
                        X:parseInt(e.xy.x),
                        Y:parseInt(e.xy.y),
                        CQL_FILTER:selectfilter(),
                        srs: map.layers[0].params.SRS};


                    // handle the wms 1.3 vs wms 1.1 madness
                    if(map.layers[0].params.VERSION == "1.3.0") {
                        params.version = "1.3.0";
                        params.i = e.xy.x;
                        params.j = e.xy.y;
                    } else {
                        params.version = "1.1.1";
                       params.y = parseInt(e.xy.y);
                        params.x = parseInt(e.xy.x);
                    }
                    OpenLayers.loadURL("http://myserver/tomcat/geoserver/india/wms", params, this, setHTML, setHTML);

在图层预览中我遇到了同样的问题,那么图层或代码的问题是什么?
N.B:如果Polygon很大,那么它会显示完美的featureinfo但是当它很小时会出现这个问题 .
我该如何解决这个问题?

1 回答

  • 1

    使用其他参数buffer

    var params = {
        buffer: 0,
        ...
    }
    

相关问题