As part of the discovery phase of a small data viz project I researched the boundaries of Obama’s Bears Ears national monument compared to Trump’s shrinkage. I wanted to display this in Leaflet, and expected the process to take about 30 minutes. The monument boundary files were in an unfamiliar format, and it took me close to three hours. The gig ended up going to someone else, but I wanted to document the process in case it helps anyone, especially future me.
Step one was to find the boundaries. The best resource I’ve found for Bears Ears is a blog post from Harvard University’s Center for Geographic Analysis, “Mapping Bears Ears National Monument.” They link to two GIS boundary resources from the U.S. Bureau of Land Management (BLM): Obama’s National Monument Extent and Trump’s National Monument Extent.
The first hang up was the unfamiliar coordinate system used by the BLM files. They were in a Geodatabase format, with a .gdb file extension. That was new to me, but I found that ogr2ogr could convert it to GeoJSON, because ogr2ogr converts anything. But the GeoJSON didn’t show up in Leaflet. Upon further review, that’s when I realized the BLM files were not in latitude, longitude. Some Google searches found that I had to add ‘-t_srs WGS84’ to get it to work. Final ogr2ogr conversion:
> ogr2ogr -skipfailures -f “GeoJSON” -t_srs WGS84 bears_ears_obmama.json NLCS_NM_NCA_historic.gdb
A similar command created the ‘bears_ears_trump.json’ GeoJSON file.
This gave me something I could show in Leaflet. However, recall that the BLM files showed the “National Monument Extent.” That means there’s more there than just Bears Ears. So I opened the files in QGIS to remove the extra stuff.
Then select Layer -> Save As to create a new GeoJSON file. I also trimmed Trump’s BLM file using QGIS.
So now we just have what we need, but the combined size of the two GeoJSON files is almost 2 megabytes. Too large for the web. Luckily MapShaper will let you upload a boundary file in multiple formats, and simplify it. (MapShaper will also handle some conversions if you don’t want to figure out ogr2ogr, but it would not have done this conversion since it does not handle Geodatabase files.)
Now the combined file sizes are one-tenth of the original, much better for web. Let’s check it out in Leaflet. Here’s the first pass. Obama’s Bears Ears is outlined in white, which Trump’s replacement is blue. This is how it came from BLM, they even looked different in QGIS.
It’s nice that Trump’s stands out, but Obama’s is hard to see. Let’s make Obama’s outline black.