Determining Landuse Buffer Zones (QGIS3)

In this tutorial you will work with landuse data for a city and determine buffer zones around a particular land parcel. Such analysis is required to establish a corridor of restrictions around noise pollution or heavy traffic.

Overview of the task

We will start with a shapefile of land parcels for the City of San Francisco and use geoprocessing and spatial analysis techniques to determine a buffer of restricted area around all properties with institutional land use.

Other skills you will learn

  • Creating rectangular buffers in QGIS

  • Using a Spatial Index to speed up analysis

Get the data

The data comes from City of San Francisco in form of parcels polygons with attribute indicating the Land use categories. You can find the data for the tutorial from DataSF Open Data Portal.

Let’s see the steps to download a polygon shapefile with land use categories for every parcel in San Francisco.

  1. Go to the data portal - https://datasf.org/opendata/. Search for the keyword Land use in the search bar.

    ../../_images/db110.png
  2. Click on the first search result to visualise and export the data.

    ../../_images/db25.png
  3. You will see the data and attributes. Click Export to download the Land Use 2020 data.

    ../../_images/db31.png
  4. In the export options, click on Shapefile to download the polygon shapefile of the data.

    ../../_images/db41.png
  5. A zip-file of the landuse will be downloaded. Switch to the About tab to read information about landuse categories and units which will be useful further in this tutorial.

    ../../_images/db51.png

For convenience, you may directly download a copy of the shapefile below:

land_use.shp

Procedura

  1. Open QGIS. Click Open Data Source Manager icon to add the layer.

    ../../_images/1101.png
  2. Switch to Vector tab and navigate to the landuse shapefile. Click Add.

    ../../_images/270.png
  3. Notice the CRS name at the bottom-right corner of QGIS. It indicates that the data is in geographic coordinate system OGC:CRS84. Click on it.

    ../../_images/337.png
  4. The Project Coordinate Reference System (CRS) dialog will show the selected CRS is WGS 84 (CRS 84). Unit of measurement for this CRS is Degree. All geoprocessing on this layer will be done in the native units of the CRS. The unit degree is inappropriate for this analysis.

    ../../_images/416.png
  5. We will reproject the layer to the projected CRS suitable for the region - NAD83 / California zone 3 (ftUS). This is EPSG:2227 which uses NAD83 datum with measurement units in feet.Go to Vector ‣ Data Management Tools ‣ Reproject Layer.

    ../../_images/515.png
  6. In the Reproject Layer dialog, select the loaded layer as Input Layer. Click on the icon beside the selector to choose the Target CRS.

    ../../_images/615.png
  7. Search for EPSG:2227 in the bar and select the NAD83 / California zone 3 (ftUS) CRS. Click Go back to continue.

    ../../_images/714.png
  8. Save the Reprojected output. Expand the browsing options and select Save to File.

    ../../_images/814.png
  9. Save the output shapefile in your chosen folder as LandUse2020.shp. Check the Open output file after running algorithm option to add the reprojected layer to QGIS.

    ../../_images/914.png
  10. Remove the original layer with CRS WGS 84 from the QGIS. Select the layer and click on Remove Layer symbol.

    ../../_images/1020.png
  11. We will continue the process with the reprojected layer. As we saw in the About section of the downloaded shapefile in the data portal, the classification is as follows.

    • CIE = Cultural, Institutional, Educational

    • MED = Medical

    • MIPS = Office (Management, Information, Professional Services)

    • MIXED = Mixed Uses (Without Residential)

    • MIXRES = Mixed Uses (With Residential)

    • PDR = Industrial (Production, Distribution, Repair)

    • RETAIL/ENT = Retail, Entertainment

    • RESIDENT = Residential

    • VISITOR = Hotels, Visitor Services

    • VACANT = Vacant

    • ROW = Right-of-Way

    • OPENSPACE = Open Space

For this tutorial, we are interested only in the Institutional land use. So we can query for the value CIE in the attribute table. Go to Processing ‣ Toolbox.

../../_images/1123.png
  1. Search the Select by Attribute tool from the processing toolbox. Double-click to open it.

../../_images/1221.png
  1. In the Select by Attribute dialog, set LandUse2020 as the Input layer. Select landuse as the Selection attribute and enter CIE as the Value. Click Run.

../../_images/1319.png
  1. You will see the parcels matching our query will be highlighted in yellow. These are all parcels belonging to the institutional land use in the city.

../../_images/1417.png
  1. Now we can create a buffer around the selected parcels. Back in the main QGIS window, open Processing Toolbox. Search and locate the Buffer tool. Double-click to open it.

../../_images/1516.png
  1. In the Buffer dialog, select LandUse2020 as the Input layer. Check the Selected features only box so the buffer will apply only to the selected institutional land use parcels. We will create a buffer zone of 100ft around each parcel. Enter 100 feet as the Distance. The default buffers are of circular shape. Since we are dealing with parcel data, a rectangular buffer area is more appropriate where each edge of the parcel will be offset by the buffer distance. Select Square as the End cap style and Miter as the Join style. Click the browse button next to Buffered and select Save to File.

../../_images/1615.png
  1. Enter the output file name as buffer.shp and click OK. Click Run.

../../_images/1716.png
  1. Once the processing finishes, a new layer buffer will be added to QGIS. These polygons represent the buffer zone of restrictions around the institutional land use.

../../_images/1814.png
  1. We now know which areas of the city fall under the restricted zone. It would be useful to identify all parcels which fall in this zone and add an attribute indicating that a restriction applies to that parcel. Let’s first add a column to the buffer polygons. Search for Field Calculator in the processing toolbox. Double-click to open.

../../_images/1912.png
  1. In the Field Calculator dialog, ensure buffer is selected as the Input layer. We don’t need to save this layer, so leave the Output file field empty. Enter RESTRICTED as the result Field Name. Set the Result field type to String. Type Yes as the Expression. Click Run.

../../_images/2012.png
  1. A new layer called Calculated will be added to QGIS. Open the Attribute Table and verify that a new column called RESTRICTED with value Yes exists in this layer.

../../_images/2115.png

22. Next step is to do a Spatial Join to add this attribute to the original parcels layer based on which parcels intersect with the buffer zone. The LandUse2020 layer has more than 100,000 elements. We will add spatial indexing to the features to improve the performance and speedup the spatial join operation. Check out the course Spatial Indexing section to understand more about this. Now, search and locate the Create Spatial Index tool from the Processing Toolbox and double-click to open.

../../_images/2214.png
  1. Select LandUse2020 as Input layer and click Run.

    ../../_images/2312.png
  2. The spatial index is created for the layer. You can verify this by checking the property of the layer. Right-click on the layer and click Properties.

    ../../_images/2411.png
  3. Switch to the Source tab and and look under the Geometry section. It indicates that the spatial index exists.

    ../../_images/2510.png
  4. Now we can do the spatial join. Look for Join attributes by location tool in the processing toolbox. Double-click to open it.

../../_images/2610.png
  1. We want to Join to features in the LandUse2020 layer By comparing to the Calculated layer. We want to join attributes features that intersect. Check the box for intersect. Click the browse button next to Fields to add.

../../_images/2710.png
  1. Select only the RESTRICTED field and click OK.

../../_images/2810.png
  1. For Join Type, select Take attribute of the first matching feature only. Next, click … next to Joined layer and select Save to File.

../../_images/299.png
  1. Enter the Joined layer name as LandUseWithRestrictions.shp and click OK. Click Run.

../../_images/309.png
  1. Once the processing finishes, you will get a new layer LandUseWithRestrictions. Open the attribute table and examine the RESTRICTED column. The parcels that fall within 100ft of an institutional parcel now have the value Yes indicating a restriction applies to that parcel. Other parcels have a NULL value indicating no restriction.

    ../../_images/3112.png

If you want to give feedback or share your experience with this tutorial, please comment below. (requires GitHub account)