I have a vector dataset with monthly water risk data per river basin. The data is available for each month (January - December) and I would like to visualize this in a browser. The geometries are constant (river basins do not change).

The data is structured as two files: a shapefile with unique identifiers and a .csv file with the unique identifiers, month and value.

The preferred way to display one month of data is using choropleths. I think a very powerful way to visualize the temporal component is to have a time slide and "play" button.

I've looked at Torque JS, Mapbox GL JS however the examples do not include choropleth examples. I can imagine other people might've solved this challenge already.

enter image description here


CARTO VL can render animated polygons, not a lot of code is involved but it depends on how much interactivity you need on your application. At the library documentation you have this example about animating polygons and then this other about adding playing controls.

Disclaimer: I work at CARTO

| improve this answer | |
  • Is this approach loading the geometries for each iteration or will it update the rendering? My geometries are appr. 70MB (15000 geometries), however it takes a long time to load. I'm getting too many request errors: 429 – RutgerH Jun 2 '19 at 20:05
  • I might have to put this into a separate question. My geometries are static and my data is updated each month. I would like to fade-in to the new month. I only need one layer and my guess is that currently the old layer is maintained. My script can be found here: github.com/rutgerhofste/cartovl_animation_test – RutgerH Jun 2 '19 at 20:32
  • yes this is for another question and more related with query performance, but a hint is that you may want to add indexes to your JOIN fields. Since you are enterprise client you may also want to contact our team directly (even I love when clients post questions on GIS SE to increase the public answers database). – Jorge Sanz Jun 5 '19 at 7:44

Have a look into Leaflet Time Dimension if you don't mind replicate the geometries you can convert your data into a time-enabled geojson like in the Oil Spill Simulation and then render each time step like a chorophlet map.

| improve this answer | |

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.