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 currently making my first steps in OpenLayers, trying to build a page showing a map where people can add data, which is then saved back in our database.

(Background: Mapping of the distribution of indigenous vegetables. We have some data, but the "crowd" should be able to add their information, too). Similar to this example (but in my case polygons should get added): http://ediblecities.org/

Is this possible with OpenLayers?

And this is maybe a too open question, but how? (a reference to a simple example would already be helpful). It does not seem possible to somehow use the tools offered in the toolbar (OpenLayers.Control.EditingToolbar(vlayer)) for this.

Thanks for taking the time!


EDIT: a more concrete follow-up question as to HOW to collect data via Openlayers, Geoserver and Postgis can be found here: How to collect data via WFS and Popup

share|improve this question
"this is maybe a too open question"... yeah. –  CaptDragon Aug 24 '12 at 15:24
yeah well, it wouldn't have helped me much if someone had answered "yes, it's possible" without even indicating how/ or giving an example ;) –  Cat Aug 27 '12 at 6:56
Thanks to you all for answering! As you have guessed correctly, I still have to learn about all server & database matter... I accidently got to the project and have never done anything like that before. We use Geoserver and there is a very small db set up for me for experimenting. At the moment I succeeded in using a bing map and adding several layers (WMS) of our data to it, getting feature information in Popups and to add the toolbar to it. –  Cat Aug 27 '12 at 7:04
@Cat I'm glad you're making progress. If you found an answer proffered here helpful, you can show that and "accept" it by clicking the checkmark on the left, underneath the votes. –  canisrufus Aug 27 '12 at 15:19
add comment

4 Answers 4

up vote 4 down vote accepted

Yes, openlayers supports vector editing in the browser and provides means for saving those vectors back to a database. As you guessed when you said "this is maybe a too open question", the full "how" is an involved answer.

Assuming that each user is not working from a blank slate, and can see the other submissions, it seems like the basic steps you want would be to

  1. load the data into the browser
  2. create/edit the data
  3. save the data

Creating polygons and editing them is the simple part. Openlayers is built to support this. An example is here: http://dev.openlayers.org/releases/OpenLayers-2.8/examples/editingtoolbar.html

Steps one and three involve OpenLayers (or something in your browser) interacting with your web server: your web server needs to "serve up" the data and then accept new versions of it.

To help you figure out what needs to be done to allow that interaction, we'd need to know more about your software stack. Do you have a database set up yet? What kind? Do you have a webserver, or a map server like MapServer or ArcGIS to serve up vectors? Or, are these things you still need to learn about? We'd/I'd be happy to help point you towards learning resources.

share|improve this answer
Hey, I now use Openlayers, Geoserver 2.1.4, and PostGIS 2.0 for PostgreSQL 9.1. I'm able to "crowdsource" polygons at the moment, but have the problem to add more feature attributes (If you can help me with this: gis.stackexchange.com/questions/34390/… -thx!). Is this a good way for crowdsourcing or is there a better way? –  Cat Sep 28 '12 at 7:27
@Cat I'll try to find time to look at it this weekend. –  canisrufus Sep 28 '12 at 13:51
Hi Canisrufus, I take it you couldn't find the time ;). I found another example and edited the question as for until now noone could help me. I would really appreciate your help or pointers as to where to look for answers... merci! –  Cat Oct 11 '12 at 7:23
@cat Okay. I'll try to look at it after work, but only because you're so polite. –  canisrufus Oct 11 '12 at 19:18
add comment

Have you already decided which server side software stack you'll use ? Do you plan to have some geospatial server such as Geoserver or Mapserver ? In which database/format do you want to store your map data ?

(sorry this should be a comment instead of an answer, but my current score does not allow me to do it)

share|improve this answer
Hi, sorry to come back to you just now (lots of stuff to learn in the meantime). I use Openlayers, Geoserver 2.1.4, and PostGIS 2.0 for PostgreSQL 9.1. I'm able to "crowdsource" polygons at the moment, but have the problem to add more feature attributes (If you can help me with this: gis.stackexchange.com/questions/34390/… -thx!). Is this a good way for crowdsourcing or is there a better way? –  Cat Sep 28 '12 at 7:24
add comment

As already mentioned by others, your question too open. However since you have asked for a simple example, you can go through this tutorial. This describes how to use OpenLayers WFS-T Using a GeoServer Hosted PostGIS Layer. Although this assumes a specific software stack, like your db as PostGIS, your map server as GeoServer, this could be a good starting point for you. Since in any case you will have to use WFS-T for online editing in openlayers.

share|improve this answer
add comment

I've develop crowdsourcing applications like this at Tomnod.com (crowdsourced analysis of satellite images). We use OpenLayers or GoogleMaps to present data to users on the web and allow them to edit (tag points, draw polygons, fill forms, etc.).

The basics of our architecture are:

  • PostGIS database (store GIS layers & crowd contributions)
  • PHP REST API (interface between DB and AJAX UI)
  • OpenLayers Map (present GIS data to users, enable tagging, drawing, etc.)
  • Custom UI elements (JavaScript/JQuery, CSS, HTML, ...)

We've built some reasonably complex apps (thousands of users, millions of points, multiple GIS layers) on this framework. OpenLayers supports most of the functionality needed for the User Interface but, for a full crowdsourcing system, you'll need a few more moving parts.

Ask a more specific question and I'll try to answer!

share|improve this answer
add comment

Your Answer


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.