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 want to edit the corresponding text/numeric data type columns of a vector through openlayres, when a user click/mouse over a vector. like,

http://dev4.mapgears.com/bdga/bdgaWFS-T.html#

any tutorial page for how to do it? I gone through it , it was difficult for me to understand from its js codes.

-- asked in stackoverflow, but no answers. based on a comment, i posted the same question here.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

"How" you do it is likely strongly linked to your toolset. But, I suspect in any toolset your flow will be something like this:

  1. Select the feature you want to edit (by map click, by search, etc...) and store the unique identifier.
  2. Retrieve the row from the database using the unique identifier as the filter.
  3. Parse the database row and create an "editor" (combobox, textbox, datepicker, etc...) for each column.
  4. Present the user with an interface based on the current values in the row and the editors.
  5. As the user enters / modifies data validate the input.
  6. On save, fashion an update query based on the user provided values and using the unique identifier as the filter.
  7. If you are using attribute information the user can edit to render the map (e.g. road symbol is based on roadtype attribute which is editable) then update the map.
share|improve this answer
    
I totally agree with iant's response that WFS-T is the best way to carry out the edit of the features, but that is only part of the toolset. You've got the get the edits to carry out. JavaScript? PHP? .NET? All of the above? –  Dave Lowther Sep 18 '10 at 0:13
    
Ya Lowther, But how to do it with the available openlayers functions that I want to know?. –  Kumar Sep 18 '10 at 8:14
2  
@Kumar, no built openlayers functions for editing attributes. Geoext have some for doing this eg dev.geoext.org/ux/geoext.ux/ux/FeatureEditing/examples/… –  ThomasG77 Sep 19 '10 at 20:00
    
Hi ThomasG77 , great comment... I will try it.. –  Kumar Sep 20 '10 at 6:52

The "How" is actually quite easy - all you need is a WFS-T server and a WFS-T capable client. You have already picked OpenLayers as your client which is a good choice as it has no problems with talking WFS-T (see http://openlayers.org/dev/examples/wfs-protocol-transactions.html).

For the server you have a choice to make - since your data is in PostGIS you are looking at GeoServer http://geoserver.org or TinyOWS http://www.tinyows.org/trac for a WFS-T server. There are plenty of docs on either site to help you get started.

share|improve this answer
1  
WFS-T is the best solution –  Mapperz Sep 17 '10 at 17:34
1  
editing geometry data is ok, but how to edit other columns of the postgis data associated with the geom? for that how to get existing data and after modifying it how to add it to openlayer wfs-t functions? so that when altering the_geom it is altering other values also. –  Kumar Sep 18 '10 at 8:17
    
That can be done with a basic form if you want complete control or look at MapFish's <demo.mapfish.org/mapfishsample/1.2/examples/editing/…; –  iant Sep 18 '10 at 11:06
    
nice, but mapfish is python based, i actually not interested to make the project more complicated by adding mapfish.where to add the other colums data in openlayers to make effect in DB, while updating geom columns? thats enough for me.. Thanks for your interest on my question, Mr Lant. –  Kumar Sep 18 '10 at 11:10

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.