This is the second part in working with the HCMGIS QGIS Desktop plugin that is rich with functionalities and to check out the first part of thewalkthrough click the link shown Working with HCMGIS QGIS Plugin Part 1
The walkthrough continues below with more functionalities.
Download Covid-19 Data
The third tool is for downloading Covid-19 data which can be used to create heatmaps showing and performing analysis on data with respect to covid-19. Click on Download Covid-19 Data shortcut under it select the first submenu shortcut as shown below.
This downloads and displays covid-19 data from the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University Hopkins data repository. The downloaded data appears as shown below in QGIS Desktop map canvas.
The map below shows covid-19 data for African countries with each dot representing country or sovereignty.
Below is the attribute table for the covid-19 point layer. Note the Country_Region column containing names of countries.
While still in the attribute table, identify and click on the icon on top of the attribute data that contains an epsilon label as shown below.
This opens selection window which will be used to demonstrate selection in QGIS Desktop by use of expression. For details on QGIS expressions refer to the QGIS Documentation.
The intention here is to select points representing countries with covid-19 cases that are beyond a given value. The first step will be to identify the field/column that contains the value of our interest. In this case identify the Fields and Values and double click to collapse it and select Active by double clicking on it as well.
Note that the double clicked field name will appear in the left text area containing double quotes. Note that all fields in QGIS expressions are represented like the one shown below. Add a greater than sign ‘>’ as shown below and add a value like 100000 as shown below.
Ensure that the expression window’s bottom left area is clear of any errors that can be indicated in red and then click Select Features button at the bottom right area of the window.
If the attribute table had been closed, open it and the selected fields will appear as shown below.
Similarly in the map, some of the points have been selected (in yellow) and represent countries that have active cases of over 100000.
In summary, we have been able to visualize covid-19 data using HCMGIS plugin and filtered the data to select only countries that have over 100000 active covid-19 cases. This is a case example among others that HCMGIS plugin can be used.
Download Open Data
Browsing for GIS data online, identifying it, downloading and extracting it can be time consuming and at times exhausting. HCMGIS plugin’s Download OpenData functionality can save some time on this and also provide up-to-date data for those repositories that update their data.
To download data from geofabrik, click on the first option under Download OpenData shortcut labelled OSM Data ye Country from Geofabrik. Geofabrik, as explained in a recent post on downloading geospatial data is an open street map data repository through which one can download data from.
On clicking the shortcut a windows is displayed and appears as shown below. It contains various controls for selection and buttons.
Click on the first drop down that contains representation of world regions. For this case, Africa region would suffice otherwise any other region can be selected.
The next step entails selecting a country within Africa region selected above. Sao Tome and Principe is the selected country as shown below. Note that different countries have different sizes of datasets and the bigger the data, the more the time it will take to download the data.
Use the browse button labelled … to navigate to he folder where the downloaded data will be saved. Select a suitable location in the local computer. A message will show informing on the size of data to be downloaded and that it may take time. The message is as shown below.
Once the download is complete, the download progress bar will be full and at 100% as shown below.
After download a success message will be shown as well indicating that the download has been completed successfully.
The downloaded data will automatically be loaded in the QGIS Desktop layers panel and in the map canvas as shown below. for Sao Tome and Principe.
Similar to previous steps, the attribute table of the data can also be opened and for this case, the attribute table appears as shown below.
In summary, HCMGIS plugin can be leveraged to download data from Geofabrik, an Open Street Map data repository o-the-fly into the machine and visualized.
Download GADM data
The other open data download supported include data from Global ADMinistrative areas repository which can be accessed from this link.
Click on the shortcut shown below to download data from GADM repository.
A window containing download options in controls appears as shown below. To begin, click on country drop down.
The drop down shows list of all countries in the world. Select your preferred country as in this case, the selected country is Kenya. as shown below.
A message showing the shapefile size to be downloaded and informs that the download may take time. Click Yes button to continue.
Once the download has started, the progress bar starts to change by increasing percentage value as the download continues in the background. Once the download has completed, the progress bar is at 100%.
A message is shown once the download is complete informing that the download process has completed successfully or with error. Click OK button to continue.
Another message similar to the messages above shows informing that the extraction of the data has completed successfully. Click OK to proceed.
The downloaded data is displayed in the QGIS map canvas and has several administrative levels. The one shown below is the administrative level zero of the whole country. Note that in the Layers panel there are four layers representing the administrative levels.
Disable all the layers by unchecking the checkboxes in the Layers panel except for the layer labelled gadm36_KEN_1 which will be shown in the map canvas as below. This is the administrative level 1 representing the counties of Kenya.
To view the attribute table right click on the active (checked) layer and click Open Attribute Data option shown below.
The attribute table for the layer will be displayed and appears as shown below.
In summary, the plugin saves the time that would take to navigate to download page using browser to download like in a previous procedure and also extracts and visualizes the data in QGIS Desktop.
Building Footprints from Microsoft
HCMGIS plugin supports spatial dataset download from Microsoft Building footprints data repository. The repository can be accessed through their GitHub repository. To access the functionality, click on the shortcut as shown below.
A window containing controls for country, province/state, file size and number of buildings among others appears as shown below. Click on the country drop down.
The only available option in this case is United States and under it select Alaska state. After selecting the above, then the number of buildings and file size is displayed in their corresponding text areas. Also ensure that the preferred save folder is selected. Click on Apply button to poceed.
A confirmation message similar to previous ones appears as shown below. Click Yes button to proceed.
Once the download is complete, a message box similar to others in previous steps is shown indicating that download has been completed. Click on OK button below.
After extraction another message box is shown and appears as below. Click OK button to proceed.
The downloaded data is visualized in the QGIS map canvas and appears as shown below. The data consist of buildings spanning across the state of Alaska.
Download Other Open Data
HCMGIS plugin supports dowloading of other data from the web through the Web Feature Service (WFS) which is an Open Geospatial Consortum (OGC) standard. Click on the the shortcut as shown below.
A window is displayed and contains controls based on the WFS specification such as the title and abstract which populate on selecting a supported service provider.
The supported service providers appear as shown below on clicking the Service Provider drop down.
One of the service providers is the HCMGIS OpenData and when selected, the abstract, title and WFS layers sections are populated and appear as shown below. This gives the user the chance to select an individual layer of interest for download.
Change the service provider to World Food Programme as shown below.
The WFS layers will change on changing the service provider. After selecting the provider, identify any layer on the WFS layers list. Note that the selected option is named geonode:food_insecurity at number 11.
Once that is selected, click Browser… button to point to the output folder where the data will be downloaded into.
Select SHAPE-ZIP as the output format which instructs the plugin to download data in the format of a zipped file.
The screenshot below shows the selected dataset of our interest.
Once Apply buton is clicked, the progress bar is activated and shows the download size in percentage. Once it completes, the progress bar appears as shown below, also the number of layers being downloaded is shown.
The data that has been downloaded appears in the QGIS map canvas as shown below.
The attribute table for the downloaded data appears as shown below.
In summary, the HCMGIS QGIS Desktop plugin can be leveraged in different ways based on users interest and can help achieve some user’s goals. Try the plugin for yourself and use different options and different datasets.