Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i'm using Postgis + tomcat + geoserver + openlayers for my application.

with the help of some tutorial i have reached upto gettting feature information of layers.

Next i want to edit and save permanently the editable layers.

I got the below code from net..

 var editable_layer= new OpenLayers.Layer.Vector("Editable Features", {
   strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
   projection: new OpenLayers.Projection("EPSG:4030"),
  protocol: new OpenLayers.Protocol.WFS({
      version: "1.1.0",
  srsName: "EPSG:4030",
  url: "http://127.0.0.1/cgi-bin/tinyows",
  featureNS :  "http://www.tinyows.org/",
  featureType: "frida",
  geometryName: "the_geom",
  schema: "http://127.0.0.1/cgi-bin/tinyows?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:frida"
  })
}); 

after that i have modified this like this

var editable_layer = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
styleMap: mystyle,
projection: new OpenLayers.Projection("EPSG:4030"),
protocol: new OpenLayers.Protocol.WFS({
    version: "1.1.0",
srsName: "EPSG:4030",
url: "http://localhost:8080/geoserver/wfs",
featureNS :  "http://localhost:8080",
featureType: "Test:ramcheck", **/*layer name*/**
geometryName: "the_geom",
schema: "http://localhost:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=Test:ramcheck" **/*i don't know how to modify this area*/**
})
});

it is not working...:)

i can't see the layer contents on the map..

please help me with a sample code..

Thanks..


Edit

I got some featureNS, feature type and featurePrefix also

then i changed my code shown below

// create three vector layers
var wfs = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.Fixed(), saveStrategy],
styleMap: sm,
projection: new OpenLayers.Projection("EPSG:4030"),
protocol: new OpenLayers.Protocol.WFS({
    version: "1.1.0",
    srsName: "EPSG:4030",
    url: "http://localhost:8080/geoserver/wfs",
    featurePrefix: "Test", **/*workspace name*/**
    featureType: "Test:ramcheck", **/*geoserver layer name*/**
    featureNS :  "http://localhost:8080/geoserver/test", **/*Workspace Namespace URI*/**
    geometryName: "the_geom"
})
});

but, below error is showing now when i try to save the edits in my layer.

 "An attempt was made to create or change an object in a way which is incorrect with regard to namespaces"

in openlayers.js below line

return data;},createElementNS:function(uri,name){var element;if(this.xmldom){if(typeof uri=="string"){element=this.xmldom.createNode(1,name,uri);}else{element=this.xmldom.createNode(1,name,"");}}else{element=document.createElementNS(uri,name);}

my geoserver workspace namespace URI is "http://localhost:8080/geoserver/test". Is there any problem in this name?

Please give your suggestions..

share|improve this question
    
    
I merged your two accounts, Ramesh: this should make it possible for you to edit your own question. As long as you do not get any replies, it's fine to keep updating and improving the question, but please don't post modifications or comments as replies. –  whuber May 24 '12 at 14:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.