5

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.


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

2
  • 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?
    – niconoe
    Commented Aug 24, 2012 at 15:13
  • 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
    Commented Sep 28, 2012 at 7:24

3 Answers 3

5

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.

4
  • 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
    Commented Sep 28, 2012 at 7:27
  • @Cat I'll try to find time to look at it this weekend.
    – canisrufus
    Commented Sep 28, 2012 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
    Commented Oct 11, 2012 at 7:23
  • @cat Okay. I'll try to look at it after work, but only because you're so polite.
    – canisrufus
    Commented Oct 11, 2012 at 19:18
1

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.

1

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!

0

Your Answer

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

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