1

In CartoDB, I want to allow a group of students to collaboratively add rows to a single table. The issue is made more complex because the table is to contain lines, not just points, so Georeferencing is harder. Ideally, students simply draw the points on a shared public map, and the rows show up in one table in my account.

The Export function for a table won't work, as it shares the data as a file, rather than allowing multiple users to add rows to a single file. Duplicate Table and Duplicate Visualization keep the data tied to a single user. Merge tables creates considerable overhead. I dislike having a shared username/password for 20 people, and that might not even work, depending on how Carto manages lockfiles etc.

The answer may simply be "Make 20 maps, upload the KML, and merge it all", but before I go that route, I'd like to know if there is a preferred way to take input from multiple users into a single table?

2

I recommend you to make a quick prototype using the CartoDB SQL API [1] in conjunction with the Leaflet.draw plugin [2]. You can find an example I made based on another by @andrewxhill: http://bl.ocks.org/matallo/130b969a6cc76939985d

You'll only have to change the cartodb account and api key by yours, as well as the table you want the rows to be saved to. In order to still be able to differentiate between the authors of the lines, I'd save them in a column, but this can easily be removed from the code.

Here's the resulting visualization in CartoDB http://team.cartodb.com/u/matallo/tables/matallo.leaflet_data/public/map

For further reference please check the next links [3] CartoDB.js SQL API editing geometry [4] Read AND write to CartoDB with the Leaflet.draw plugin —for more functionality such editing, but a bit more advanced as it involves sql functions—.

Cheers,

  • Matalio, many thanks for this. I haven't used Leaflet yet, so off to check that out. – Clay Shirky Feb 17 '15 at 1:16
0

You can use this CartoDB + Leaflet combination to let your users draw geometries and insert them into your table by using security definers: http://blog.cartodb.com/read-and-write-to-cartodb-with-the-leaflet-draw-plugin/

Another approach could be having a collaborative spreadsheet in GDrive, including the the_geom column that would need to be populated manually, and synchronize it with CartoDB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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