4

I want to edit the corresponding text/numeric data type columns of a vector through OpenLayers when a user clicks/mouse over a vector. like,

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

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

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

Val P
3,9501 gold badge10 silver badges34 bronze badges
asked Sep 17, 2010 at 11:24

2 Answers 2

5

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.

answered Sep 17, 2010 at 14:38
4
  • 1
    WFS-T is the best solution Commented Sep 17, 2010 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. Commented Sep 18, 2010 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/…> Commented Sep 18, 2010 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. Commented Sep 18, 2010 at 11:10
3

"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.
answered Sep 17, 2010 at 13:31
4
  • 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? Commented Sep 18, 2010 at 0:13
  • Ya Lowther, But how to do it with the available openlayers functions that I want to know?. Commented Sep 18, 2010 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/… Commented Sep 19, 2010 at 20:00
  • Hi ThomasG77 , great comment... I will try it.. Commented Sep 20, 2010 at 6:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.