So GitHub announced that you can now automatically view any GeoJSON files that may be in a repository inside an interactive map driven by MapBox technology. This simple enhancement to GitHub is probably one of the most significant developments in the geospatial industry in years. I’ll explain a little later in this post. It’s also important to view this new capability as a great, but limited, first step. I’ll discuss that a little later as well.
While it’s cool to click on a link and just see a map, it doesn’t take long to wonder about how you can use this capability beyond viewing data in GitHub. What follows are three ways to capitalize on GeoJSON in GitHub. Not all are directly related to the new mapping capability, and two have been possible for a long time. That said, the GitHub announcement may draw interest from users who have not previously considered either GitHub or GeoJSON, so I hope these approaches will be useful.
- Embed the GitHub map.
If you click on a GeoJSON file and view the new map in GitHub, a quick view of the page source will show that this map is embedded in an IFRAME object. This approach can be used to embed the GitHub map in any page. It’s a great way to quickly publish a data set while also providing access to download the raw data.