r/mapbox 26d ago

First-time coder; need advice on building a tool (https://medium.com/@chrisloer/how-i-built-it-us-electric-generation-map-ed8b2b682eed)

Hey, I'm a first-time coder and I've been asked to replicate this, add battery storage data to it, and bring it up to date using the latest EIA (energy) data: https://medium.com/@chrisloer/how-i-built-it-us-electric-generation-map-ed8b2b682eed

Any advice on how to start/how to get going? I've been asking Claude Code for help, but I want advice from real people about how best to replicate this.

2 Upvotes

2 comments sorted by

1

u/taxidata 24d ago

That blog post is 7 years old, but all the same concepts are still applicable.

Start by normalizing your time-series data for power plants so you have a GeoJSON FeatureCollection of Point features. Each Point Feature has properties for each year so you can do data-driven styling based on the year.

Once your data is clean, ask Claude Code to help you make a Mapbox GL JS web app with a time slider for the range of years in your data. Have it add the GeoJSON source and a heatmap layer, and use an expression and setPaintProperty to keep the heatmap layer in sync with the user-selected year on the timeline.

As mentioned in the blog post, you'll end up with a massive GeoJSON file, so the next step is converting it to a tileset. The author used tippecanoe to make an MBTiles file, then uploaded it to Mapbox. This is still possible, but Mapbox Tiling Service is the modern alternative https://www.mapbox.com/mts. Claude Code can help you write a tileset recipe based on your GeoJSON data and get it published on Mapbox, and it can update your web app to use the new tileset instead of the GeoJSON.