首页 文章

openlayers和geoserver将功能发布到postgis时出错

提问于
浏览
1

我发现openlaters和geoserver向postgis发布功能时出错 . 代码如下所示 . 错误是由XMLSerializer从var'node'转换的var'data'是错误的,其中X和Y的顺序是相反的,就像“28.795251846313476 116.4409589767456” . 所以geoserver拒绝了请求,因为Y的坐标超出了(-90,90) .

var feature = evt.feature;
var node = format.writeTransaction([feature], null, null, {
                gmlOptions: {srsName: "EPSG:4326"},
                featureNS: "ucoc.zhtx.com",
                featureType: "landblock"     
            });             
var data=new XMLSerializer().serializeToString(node);

1 回答

  • 1

    欢迎来到轴心故障的精彩世界 . 幸运的是,GeoServer有[lon,lat]订单的替代SRS代码,它是“CRS:84”而不是“EPSG:4326”:

    var feature = evt.feature;
    var node = format.writeTransaction([feature], null, null, {
      gmlOptions: {srsName: "CRS:84"},
      featureNS: "ucoc.zhtx.com",
      featureType: "landblock"     
    });             
    var data = new XMLSerializer().serializeToString(node);
    

相关问题