Borders change over time, inevitably creating issues when working with maps using GeoJSON regions. So, you may have to update your map's regions to reflect new boundaries. This help doc will walk you through updating those regions using a free online tool called Mapshaper.
In this help doc, we're going to update the 2018 United States Congressional districts to the 2022 Congressional districts.
TIP: Are you struggling to find the right regions for your map? Check out our GeoJSON repository where we've sourced, checked, and resized various region files ready for you to download and use in Flourish.
- 1
-
Upload the U.S. States map GeoJSON from Flourish to Mapshaper.
You can do this by clicking on Select when you first open Mapshaper, which will allow you to select and upload a GeoJSON from your desktop:
You can also upload from your desktop from a drop down panel in the center of the Mapshaper webpage and clicking on Add files.
- 2
-
Upload the 2022 Congressional districts map to Maphaper. https://geodata.bthttps://
geodata.bts.gov/search? groupIds= 4700230195de47569ad913b9d495b1 2fs.gov/ is a great resource to get public domain GeoJSON files of more U.S. maps and regions. Then repeat this process with a GeoJSON map of US states.
- 3
-
When you select your layers from the panel in the top middle of the Mapshaper window, confirm that the Congressional Districts have a black eye icon next to them and the States have a green one next to them.
You may have to toggle the eye icon from grey to green by clicking on it. If the eye icon colors are reversed for these layers, simply delete your layers and re-upload them in the opposite order than you did the first time.
- 4
-
Note how some of the black lines, like those around the state of Michigan show Congressional boundaries outside of the state lines.
To maintain the shape of the state with Congressional boundaries within them, select Console towards the top right of the Mapshaper page and type clip [the name of the green layer] into the console, followed by pressing the enter key.
In this case, clip us_states achieves this result.
- 5
-
Now, the 2022 Congressional District regions have been applied to the U.S. States. You can export the file contained in Mapshaper as a GeoJSON file and import it to Flourish.