How to load GeoJSON Data to QGIS
Hello, I am Thuha and welcome to this tutorial. In this tutorial, I am going to show you how to load GeoJSON data to QGIS. This data will be both from a GeoJSON file and a RESTful API that returns GeoJSON.
- Loading GeoJSON file to QGIS
To load a GeoJSON file to QGIS is straightforward process. You can just drag the file to the map canvas as shown in the images below.
The result from this specific file, which is basically a GeoJSON file of all the major towns of Kenya, can be seen from the following screenshot.
To view the attribute table, just right click on the layer you want to view the attribute table on the layer panel as show in the screenshot below
The attribute table can be viewed as shown
- Loading GeoJSON from a RESTful API
In this next part, we are going to load GeoJSON from an endpoint provided by an API. The API we are using here is developed by me and shows the location on illegal dumpsites in Nairobi.
Opening this endpoint on a browser will give a JSON response.
https://nairobi-safi.herokuapp.com/api/get-reported-dumpsites
Now, to load this data to QGIS, click the Open Data Source Manager icon highlighted in the image shown below.
This step will open the following screen. Ensure that the Radio Button is selected. Once you select the HTTPS protocol, you can then fill the URI field with the endpoint described above. The following screen illustrates this.
After this, the Add button will be activated and once you click on it the data will be added to the canvas and will look like it is shown in the following image. You can even open the attribute table as explained above. The following image shows the data from the API added to the canvas.
Thanks for following.