I have used Google Spreadsheets as a way to provide our large organisation a way to update carto maps with new locations without needing to consistently contact the web/GIS teams but only with pushpins.

I now have had a request to do this using polygons however I have no clue of if Carto will import (and synch) polygons from Google Spreadsheets and what format the geo-area field should be. The polygons do not change, just the values associated to the fields.

Any help or a sample spreadsheet would be wonderful.

District | geojson | population |
North East | geojson | 2,340,000 |

  • can you give a more detailed example? is the geojson just with the geometry or also more associated values? – Jorge Sanz Apr 11 '18 at 8:19
  • I have mocked up a simple spreadsheet with the nine weather districts of Victoria, Australia at docs.google.com/spreadsheets/d/… and I would like Carto to synch it every hour so that the layers appear like this mockup dhhs.cartodb.com/viz/0f74f228-bc71-41bb-ab01-b5ebee3d75e2/… but with the appropriate colours. The issue is how to place the polygon into col c so it renders correctly and that users can use the hover popup to see the fire danger index. – Ewen Apr 12 '18 at 1:10
  • your polygons don't change? – Jorge Sanz Apr 13 '18 at 8:56
  • No they don't. If they do in a few years we would manually replace these with the new ones. – Ewen Apr 17 '18 at 2:06

From your comments above it seems like your geometries don't change so what I think the best approach is to have a Google Spreadsheet with only the business data that changes. Then in your CARTO account, you have a master table with the geometries and consistent identifiers that you use to run a join analysis with the synced table.

You have a full guide on the process here, which is called Add columns from a second dataset.

enter image description here

  • This looks excellent Jorge. Will have a play on Monday and see how it pans out. Most impressed and it keeps the kiddies away from the dangerous stuff in the spreadsheet. – Ewen Apr 20 '18 at 7:29
  • Excellent, if you still have issues, add more detail to your question – Jorge Sanz Apr 21 '18 at 14:17
  • Superb and it does exactly what it says. I have found three ways of doing this now with the one Jorge providing the best. The other two were SQL e,g, SELECT serviceareas.cartodb_id, serviceareas.the_geom, serviceareas.servicearea, serviceareas.the_geom_webmercator, safetyhubs.phonenumber FROM serviceareas INNER JOIN safetyhubs ON serviceareas.serviceareaid = safetyhubs.serviceareaid I was also told that you can use Well known Binary (WKB) as the_geom field to get around this. This only works if each area is < 50,000 chars and sadly mine did not. Kudos Jorge! – Ewen Apr 23 '18 at 1:43
  • awesome, thanks for adding a few more details for future visitors!! – Jorge Sanz Apr 24 '18 at 6:30

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.