#StandWithUkraine - Stop the Russian invasion

Join us and donate. We are contributing all book royalties from 2022 to present to:
Save Life in Ukraine and Ukraine Humanitarian Appeal.

Find GeoJSON Boundary Files

You may be searching for geographic boundary files in GeoJSON format to create a customized map. For example, both the Datawrapper tool described in Chapter 7 and the Leaflet map code code templates described in Chapter 13 allow you to upload your own GeoJSON files. Since GeoJSON is an open-data standard, you may find these files in several open data repositories listed in Chapter 3.

Another way to find and download GeoJSON files is the clever Gimme Geodata tool, developed by Hans Hack, which provides quick access to multiple layers of OpenStreetMap boundary files. When you open the tool, search for a location and click a specific point on the map. The tool displays the names and outlines of different geographic boundaries around that point that have been uploaded into OpenStreetMap, which you can select and download in GeoJSON format. For example, when you search and click on Toronto Centre, the tool displays several neighborhood-level boundaries, the Old Toronto city boundary, the present-day Toronto city boundary, and regional and provincial boundaries, as shown in Figure 13.3. Read more details about each layer to evaluate their accuracy, then select any layer to download in GeoJSON format. The tool also includes an editor (the scissors symbol) to remove water areas from the boundary file (such as deleting Lake Ontario from Toronto). When using any type of data that you downloaded from OpenStreetMap, always credit the source in your final product like this: © OpenStreetMap contributors. Learn more about OpenStreetMap copyright and licensing policy.

Use the Gimme Geodata tool to select a point and download surrounding geographic boundaries from Open Street Map.

Figure 13.3: Use the Gimme Geodata tool to select a point and download surrounding geographic boundaries from Open Street Map.

Tip: When you download a GeoJSON file that contains spaces in its name (such as Old Toronto.geojson), replace the spaces with either hyphens or underscores (such as Old-Toronto.geojson). This will avoid problems with visualization tools in this book that do not recognize spaces in file names.

Now that you know how to find geodata, let’s look at free online tools to create, convert, edit, and join GeoJSON files with other types of data.