Error when posting features to postgis by openlayers and geoserver

后端 未结 1 380
慢半拍i
慢半拍i 2021-01-25 09:11

I found an error when posting features to postgis by openlayers and geoserver. The code is listed below. And the error was that the var \'data\' which was converted from the var

相关标签:
1条回答
  • 2021-01-25 09:49

    Welcome to the wonderful world of axis orientation trouble. Fortunately, GeoServer has an alternative SRS code for [lon, lat] order, which is "CRS:84" instead of "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);
    
    0 讨论(0)
提交回复
热议问题