Difference between revisions of "Hospital Site Suitability Selection using QGIS"
(→Data) |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 38: | Line 38: | ||
[[File:Extract_All.jpg]] |
[[File:Extract_All.jpg]] |
||
− | Once you have downloaded the files, you will need to extract the |
+ | Once you have downloaded the files, you will need to extract the zipped files in your DATA folder. |
Now only one more file is needed, which will contain the location of all of the existing hospitals in Vancouver. Because there is not file for this in the Vancouver Data Catalogue, we will use Google Earth to find all hospital locations in Vancouver, then export them as a KMZ file. To do this, open Google Earth and search for "hospitals in Vancouver, BC". |
Now only one more file is needed, which will contain the location of all of the existing hospitals in Vancouver. Because there is not file for this in the Vancouver Data Catalogue, we will use Google Earth to find all hospital locations in Vancouver, then export them as a KMZ file. To do this, open Google Earth and search for "hospitals in Vancouver, BC". |
||
Line 71: | Line 71: | ||
=== Importing Data === |
=== Importing Data === |
||
To import the required data into QGIS, you will use the Browser panel on the left of the screen. Expand the "Project Home" section and you will see all the files you downloaded. Click the files you wish to import to select them (you can select multiple by holding the "Ctrl" key), then drag them into the center of the screen. All your files will now be added to the data frame. If you do not see anything, right click on one of the layers in the "Layers" panel, and select '''Zoom to Layer'''. You should have all the same layers as those seen in the screenshot below. |
To import the required data into QGIS, you will use the Browser panel on the left of the screen. Expand the "Project Home" section and you will see all the files you downloaded. Click the files you wish to import to select them (you can select multiple by holding the "Ctrl" key), then drag them into the center of the screen. All your files will now be added to the data frame. If you do not see anything, right click on one of the layers in the "Layers" panel, and select '''Zoom to Layer'''. You should have all the same layers as those seen in the screenshot below. |
||
+ | |||
+ | [[File:BeforeReorder.jpg|caption]] Before reordering |
||
+ | |||
+ | [[File:Reorder.jpg|caption]] After reordering |
||
Now, reorder the layers by dragging them in the "Layers" panel so that as many as possible are visible. You can also change the color and symbols for the layers by clicking them and changing the setting in the "Layer Styling" panel on the right (if this is not visible for you, right click the top toolbar and click '''Layer Styling Panel''').You’ll notice that some of the points in the hospital file you created don’t lie within Vancouver's boundaries; this is not a problem as later on in this tutorial the non-valid points will be dissolved. Once you have all the required data imported and looking acceptable, you can move on to the next step. |
Now, reorder the layers by dragging them in the "Layers" panel so that as many as possible are visible. You can also change the color and symbols for the layers by clicking them and changing the setting in the "Layer Styling" panel on the right (if this is not visible for you, right click the top toolbar and click '''Layer Styling Panel''').You’ll notice that some of the points in the hospital file you created don’t lie within Vancouver's boundaries; this is not a problem as later on in this tutorial the non-valid points will be dissolved. Once you have all the required data imported and looking acceptable, you can move on to the next step. |
||
Line 82: | Line 86: | ||
=== Extracting Residential Areas from the Zoning Districts === |
=== Extracting Residential Areas from the Zoning Districts === |
||
+ | |||
+ | [[File:Select_Features.jpg]] |
||
+ | |||
One of our criteria for hospital site selection is that the location must be within a certain distance of residential areas, so we need to extract all the residential areas from the zoning districts shapefile. To do this, right-click on the zoning_districts layer and select '''Open Attribute Table'''. The attribute table for the zoning districts will open, and the zoning category for each feature will be shown in the "CATEGORY" column. We want to select all features with categories that contain the word "Dwelling", as this denotes that it is residential. To do this, select '''Select Features Using an Expression''' from the top toolbar. A '''Select By Expression''' window will appear, and for the expression type: |
One of our criteria for hospital site selection is that the location must be within a certain distance of residential areas, so we need to extract all the residential areas from the zoning districts shapefile. To do this, right-click on the zoning_districts layer and select '''Open Attribute Table'''. The attribute table for the zoning districts will open, and the zoning category for each feature will be shown in the "CATEGORY" column. We want to select all features with categories that contain the word "Dwelling", as this denotes that it is residential. To do this, select '''Select Features Using an Expression''' from the top toolbar. A '''Select By Expression''' window will appear, and for the expression type: |
||
"CATEGORY" LIKE '%Dwelling%' |
"CATEGORY" LIKE '%Dwelling%' |
||
Line 94: | Line 101: | ||
=== Merging Shapefiles === |
=== Merging Shapefiles === |
||
+ | |||
+ | [[File:Merge_Streets.jpg|caption]] Merging street files |
||
+ | |||
+ | [[File:Merge_rail.jpg|caption]] Merging rail files |
||
+ | |||
Because we want to perform operations on ''all'' of the street shapefiles and ''all'' of the railway shapefiles, we need to merge them. To do this, click '''Vector > Data Management Tools > Merge Vector Layers'''. For ''Input files'' select all of the files to be merged. Under the ''Merged'' field select ''Save to file'' and save it into your "Data" folder. Uncheck the box for '''Open output file after running algorithm''' then click '''Run in Background'''. Once the operation is completed use the "Browser" panel to add your new file to the data frame (if you don't see it hit the refresh button at the top). Follow these steps to merge all the road shapefiles (lanes, non_city_streets, one_way_streets and public_streets), then all the railway shapefiles (railways and rapid_transit). |
Because we want to perform operations on ''all'' of the street shapefiles and ''all'' of the railway shapefiles, we need to merge them. To do this, click '''Vector > Data Management Tools > Merge Vector Layers'''. For ''Input files'' select all of the files to be merged. Under the ''Merged'' field select ''Save to file'' and save it into your "Data" folder. Uncheck the box for '''Open output file after running algorithm''' then click '''Run in Background'''. Once the operation is completed use the "Browser" panel to add your new file to the data frame (if you don't see it hit the refresh button at the top). Follow these steps to merge all the road shapefiles (lanes, non_city_streets, one_way_streets and public_streets), then all the railway shapefiles (railways and rapid_transit). |
||
Latest revision as of 21:40, 3 October 2019
Purpose
The purpose of this tutorial is to show users how to perform a site suitability analysis for hospital placement, using QGIS. This tutorial will focus on Vancouver, BC to provide an example of how to complete this task. In the process users will gain a better understanding of free and open source software (FOSS), learn how to extract spatial data from Google Earth for use in other GIS software, as well as how to set up and manipulate data in QGIS.
Introduction
When building a new hospital, there are criteria that should be followed in order to find the most appropriate location. These criteria consist of required proximities or distances from certain features, such as roads and public washrooms. Using GIS software, a map can be created of all areas in a city that meet these criteria, which can be used to select a hospital location. In this tutorial, a map of suitable areas for hospital construction in Vancouver will be created. The criteria used in this tutorial will be based on two papers (GIS-Based Multi-Criteria Analysis for Hospital Site Selection in Haidian District of Beijing (Zhou and Wu, 2012) & Hospital Site Selection Using Two-Stage Fuzzy Multi-Criteria Decision Making Process (Soltani and Morandi, 2011)) and are summarized in the following image:
Software
The two software packages required for this tutorial are QGIS and Google Earth. If you do not already have these on your computer, you can use the following instructions to get them.
To download QGIS, click on this link and choose which version you would like. Version 3.8 under the "Latest Release" section will be used for this tutorial. Other version will be able to do everything in this tutorial, though the names and locations of certain tools and options may be different. The alternative is the "Long term release repository" version, which is an older release so it's more stable, but also has less features.
To download Google Earth, click this link and select Agree and Download. Once you have downloaded and installed both software packages, you are ready to download the required data for this tutorial.
Data
Create a working folder wherever you would like your project file to be saved, and within it make another folder titled "Data". This is where all of the data needed to complete this tutorial will be stored. For this project, all the required data is available at http://data.vancouver.ca/datacatalogue/, except for the file for hospital locations which will be extracted from Google Earth. From the Vancouver data catalogue, you will need to download the following files:
-Fire halls -Local area boundary -Railway -Rapid transit lines -City streets package -Zoning districts and labels -Public washrooms
To download the files, simply click the links above. The files are all in SHP format, except for Public washrooms which does not have an SHP version available, so it is a KML file. Next extract the contents of the files you downloaded into the "Data" folder you created earlier.
Once you have downloaded the files, you will need to extract the zipped files in your DATA folder.
Now only one more file is needed, which will contain the location of all of the existing hospitals in Vancouver. Because there is not file for this in the Vancouver Data Catalogue, we will use Google Earth to find all hospital locations in Vancouver, then export them as a KMZ file. To do this, open Google Earth and search for "hospitals in Vancouver, BC".
Next, click the folder icon below the search results that says “Copy the current search results to My Places” when you hover over it.
Now right click on the folder containing your search results and select Save Place As...
Give the file a name and make sure the Save as type: is Kmz, then save it into your "Data" folder. Now that you have all the required files, you are ready to start the tutorial.
Tutorial
Now that you have downloaded the software and collected the required data, it is time to begin. Open QGIS, click the New Project button (white piece of paper) in the top left to start a new project. Save the project file into your working folder under whatever name you choose (try not to use spaces or funny characters in your file name).
Setting Up the Environment
Vancouver’s data files are projected in UTM Zone 10, NAD83 (CSRS) so that is what you should project your files as. To do this, go to the Project menu, select Properties. The Project Properties windows will open. Go to the CRS tab, then in the search box search for "NAD83(CSRS) / UTM zone 10N" and select it from the list. This will automatically project all files in your data frame according to this coordinate reference system. Click Apply to apply the change. From this window, under the General tab, you can set the project's home directory, which should be your "Data" folder. Once this is done, click Apply then OK.
Importing Data
To import the required data into QGIS, you will use the Browser panel on the left of the screen. Expand the "Project Home" section and you will see all the files you downloaded. Click the files you wish to import to select them (you can select multiple by holding the "Ctrl" key), then drag them into the center of the screen. All your files will now be added to the data frame. If you do not see anything, right click on one of the layers in the "Layers" panel, and select Zoom to Layer. You should have all the same layers as those seen in the screenshot below.
Now, reorder the layers by dragging them in the "Layers" panel so that as many as possible are visible. You can also change the color and symbols for the layers by clicking them and changing the setting in the "Layer Styling" panel on the right (if this is not visible for you, right click the top toolbar and click Layer Styling Panel).You’ll notice that some of the points in the hospital file you created don’t lie within Vancouver's boundaries; this is not a problem as later on in this tutorial the non-valid points will be dissolved. Once you have all the required data imported and looking acceptable, you can move on to the next step.
Converting KMZ to Shapefile
In order to be able to perform operations such as buffer and clip on the public washroom and hospital files, they will need to be converted from KMZ format to SHP. To do this, right click the file from the "Layers" panel, then select Export > Save Features As. In the pop-up window, make sure the Format is ESRI Shapefile, then choose the output name and location (your "Data" folder) by selecting the Browse button. Make sure the CRS is Project CRS (EPSG:26910 -NAD83 / UTM zone 10 N) then click OK. Do this for the public washroom file and the hospital file. Once both shapefiles have been added, you can remove their original layers from the project.
Extracting Residential Areas from the Zoning Districts
One of our criteria for hospital site selection is that the location must be within a certain distance of residential areas, so we need to extract all the residential areas from the zoning districts shapefile. To do this, right-click on the zoning_districts layer and select Open Attribute Table. The attribute table for the zoning districts will open, and the zoning category for each feature will be shown in the "CATEGORY" column. We want to select all features with categories that contain the word "Dwelling", as this denotes that it is residential. To do this, select Select Features Using an Expression from the top toolbar. A Select By Expression window will appear, and for the expression type:
"CATEGORY" LIKE '%Dwelling%'
Now click the Select features button in the bottom right hand corner and all the desired features will be selected, then click Close.
The selected zones that are now highlighted and can be saved as their own shapefile. To do this, right click on the zoning_districts layer and select Export > Save Selected Features As. Save it into your "Data" folder with ESRI Shapefile as the format. Make sure Save only selected features and Add saved file to map are toggled on, leave the CRS as is, then click OK.
Merging Shapefiles
Because we want to perform operations on all of the street shapefiles and all of the railway shapefiles, we need to merge them. To do this, click Vector > Data Management Tools > Merge Vector Layers. For Input files select all of the files to be merged. Under the Merged field select Save to file and save it into your "Data" folder. Uncheck the box for Open output file after running algorithm then click Run in Background. Once the operation is completed use the "Browser" panel to add your new file to the data frame (if you don't see it hit the refresh button at the top). Follow these steps to merge all the road shapefiles (lanes, non_city_streets, one_way_streets and public_streets), then all the railway shapefiles (railways and rapid_transit).
Buffering Files
Now we need to buffer each of the shapefiles in order to make them meet the criteria for hospital site selection. To do this go to Vector > Geoprocessing Tools > Buffer. Start by buffering your newly merged street shapefile. Select that file as the input, the set the distance to 100 meters, as that is the value given in the site suitability criteria. The "Segments" field controls how many line segments make up each quarter-circle in the buffer results, a higher value will give a rounder result, but it will be more complex as well. 25 is a good number of segments, so use that value for this buffer. Check the box saying "Dissolve result", deselect the option to add the output after running, then choose to save the file into your "Data" folder. Leave the rest of the settings untouched and hit Run in Background. Once it is finished running, close the window then add your new file to the data frame through the "Browser" panel.
Repeat this with each of the remaining shapefiles, setting the distance based on the criteria shown in the picture below.
Once you have buffered all the required filed, the finished result should look something like this:
Merging Shapefiles (again)
Now that all of the original shapefiles have been buffered and clipped to only show the portions that are applicable for hospital site selection, we need to merge all of the shapefiles with criteria to be within a certain distance (residential, streets, railways, and fire halls). To do this repeat the process outlined for merging earlier, but this time choose the files mentioned here.
Difference
Because we want to exclude the land that is within a certain distance of public toilets and existing hospitals, we must remove these areas from the shapefile we created in the previous step. To do this go to Vector > Geoprocessing Tools > Difference. The Input layer should be the merged shapefile from the previous step. The Difference layer should be the hospital buffer (we will repeat it after for public washrooms). Choose to save the file into your "Data" folder, and deselect the option to open the output file after running. Click Run in Background then once its finished close the window and add the new file to the data frame.
Repeat for the washrooms, but this time the Input layer should be the difference file you just created, and the Difference layer should be the washroom buffer.
Dissolve
Because we performed multiple operations on the final file, it will contain many overlapping polygons. To eliminate any overlap we should dissolve everything, making it into one clean and inclusive shapefile. To do this, go to the Vector > Geoprocessing Tools > Dissolve. The Input vector layer should be the shapefile you just creating when removing the public washroom buffer from the acceptable areas merge. Have the file be saved into your "Data" folder and deselect the option to open the file after running. Click Run in Background then once it finishes close the window and add your new file to the data frame.
The final result of all of the processes we have performed should look something like the picture below. This polygon represents all areas of Vancouver that are suitable for hospital construction, according to our criteria.
Making a Map
Now that we have produced the data that we want to showcase, we can use QGIS to make it into a map. First, in the "Layers" panel make sure all the layers you want visible in the final map are checked, and that the ones you don't are unchecked. In our map we will display streets, hospitals, railways, and of course the suitable hospital area we created.
To make your map layout, go to Project > New Print Layout then type in a name for your map and select OK (it does not have to be the same as the title you place on your final map). A new window will then open which lets you design your layout. To add the map to your layout, select Add Item > Add Map at the top of the screen, then drag out a rectangle on the canvas where you would like it to be. To re-position your map display, use the Move item content tool which can be activated on the left of the window. To move the map or any other features around the page, use the Select/Move item tool. You can resize the map by changing the scale, which is under the Item Properties tab on the right hand side.
Once you are happy with the placement and size of your map, you can add the other required components which include a title, legend, scale bar and north-arrow. To add a title, select Add Item > Add Label and draw a box for your title. In the "Item Properties" panel, under Label you can type your title in the textbox and change the font type, size, colour etc.
To add a north arrow, select Add Item > Add Picture and draw a box on your canvas. In the "Item Properties" panel, under Search directories you can view different North Arrows and choose which one you would like to use.
Similarly, you can add a scale bar by selecting Add Item > Add Scalebar.
To add a legend select Add Item > Add Legend. To show only the legend items that are present on your current map, select the icon that resembles a filter cone under the Item Properties > Legend items menu. To rename legend items, double click a legend item and enter the text you want displayed. You can also rearrange legend items by dragging them up and down.
Once you have found a good placement for all the items, and have tuned their properties to your liking, you can export the layout as an image, SVG or PDF by selecting Layout in the top left and choosing either Export as Image, Export as SVG or Export as PDF.
Conclusion
In this tutorial, you have learned how to produce a map in QGIS, showing suitable areas for hospital placement in Vancouver, BC, based on a specified set of criteria. However, the applicability of the techniques learned here is not limited just to this location, these criteria, or this exact purpose. By using different data and altering the buffer distances, these steps could be used to determine suitable placement areas for almost anything, and according to any set of criteria. More broadly, the skills acquired here, relating to setting up a QGIS project, manipulating data, and creating a map layout, can be used for countless other purposes. QGIS is a well-crafted and easy to use software, and this tutorial is just an example of the many ways that data can be manipulated within it to perform geographic analysis and produce informative maps. It also shows that the barrier to entry for GIS analysis is much lower than many people realize, as QGIS is free as long as you have a computer to run it.
References
- City of Vancouver (2017). Open Data catalogue | City of Vancouver. Retrieved December 18, 2017 from City of Vancouver http://data.vancouver.ca/datacatalogue/index.htm
- Google (2017). Download Google Earth. Retrieved December 18, 2017 from Google https://www.google.com/earth/download/gep/agree.html
- QGIS. (2014). Download QGIS. Retrieved December 18, 2017 from QGIS http://www.qgis.org/en/site/forusers/download.html
- Soltani, A. & Marandi, E. Z. (2011). Hospital Site Selection Using Two-Stage Fuzzy Multi-Criteria Decision Making Process. Journal of Urban and Environmental Engineering, 5 (1). Retrieved from https://doaj.org/article/62479c17294e4cfb9a5777caaf2c7a38
- Zhou, L. & Wu, J. (2012). GIS-Based Multi-Criteria Analysis for Hospital Site Selection in Haidian District of Beijing. Retrieved October 24, 2017 from https://www.diva-portal.org/smash/get/diva2:555935/FULLTEXT01.pdf