News & Insights

Shapefile Creation for the AlliedOffsets Geo-database

Written by Hattie Partner | Mar 19, 2024 8:20:59 AM

AlliedOffsets has a comprehensive database of geospatial information, including over 1,800 shapefiles of projects from a range of registries. This blog will explain how we create these shapefiles with QGIS by two methods: creation from project design documents (PDDs), and cleaning up existing shapefiles sourced from registries or clients. 

Creation from Project Design Documents

Many of our shapefiles are based on the maps provided in project design documents (PDDs). Consider, for example, the Keo Sima REDD project (VCS1650, registered with Verra). This project is located in Cambodia in the Seima Protection Forest (SPF) within the Mondulkiri and Kratie provinces. 

We first select the most detailed and explicit depiction of the project area within the PDD, take a screenshot from which to draw a polygon, and save the image so that it can be imported into QGIS as a raster layer. In the below screenshot of VCS1650, the project area is dark green, shown as SPF Core Area in the key, and the red dashed square indicates the cropped image which will be used in shapefile creation.

We select a global base map to underlay all the layers. Because correctly emplacing the raster layer is not an automatic process (i.e., QGIS does not match the map in the screenshot to the base map), we manually locate the project area so that the polygons can be drawn and georeferenced to the correct location. In this blog, the Google Maps base map layer is used because it has the most user-friendly interface and is often the closest match to the maps in PDDs. 

To make correct positioning easier, we find common points in both the raster and base map such as road junctions, water bodies (although approach this with caution, since these change gradually over time), and regional borders. The Coordinate Reference System (CRS) is set to WGS 84 (EPSG:4326) as it is a widely-accepted coordinate system as a global standard, and works in latitude and longitude. We then import the image using the Freehand Raster Georeferencing toolbar. Using that toolbar, we select “Add raster for interactive georeferencing” to import the image as a raster layer over the base map which corresponds to the project’s location, as shown below. 

 The raster’s new position is indicated by the red arrow. 

A brand new shapefile layer is added, which will contain all the polygons representing project areas taken from the PDDs; the most important field is “uid” because this is the main project identifier corresponding to each polygon.

If there is an existing shapefile being used to store the project polygons, we instead switch on edit mode for this layer. Next, we select the “Add polygon feature” to begin drawing around the project area within the raster. 

We digitise with segments – although, if the shape requires more intricate drawing, we use the streaming tool, which moves with the cursor. The images below show the process of drawing the polygon for VCS1650. (Note the green Xs on the southeastern border of the shapefile.)

 

Clean-Up of Existing Registry Shapefiles

Another route for shapefile creation for our geodatabase is via the clean-up of existing shapefiles. These may exist as either .shp or .kml files, with the latter requiring an additional step to transform the data into a shapefile polygon. In this blog, we can also refer to project VCS1650 because it has an updated KML file from 2023 stored in the Verra registry. The KML file is added as a layer in the left image below, and then exported as a shapefile so it is now present as a polygon in the right image.

In the “Vector Geometry” section of the Processing Toolbox, we use the “Check Validity” tool to automatically inspect the geometries of selected polygons. This is necessary because files uploaded to registries may have geometry errors like self-overlaps or self-intersections, or there may be issues with import/export of those files. The output pools the polygons into “Valid” and “Invalid” outputs with an additional point layer to indicate which vertex of a polygon is causing the invalidity: this gives us an idea of how much additional work must be done to correct these invalid geometries.

The accuracy of the polygons in “Valid” can be cross-referenced with the original polygons, and there may be slight differences where the tool has infilled gaps or simplified overly-complex geometries in an attempt to rectify any issues. Whilst each GIS software has different pros and cons with its validity checking tool, we also check the validity of shapes when adding to the database outside of QGIS to ensure that our shapefiles are as geometrically accurate as possible. 

If there are many invalid polygons, we use the “Fix Geometries” tool also within the “Vector Geometry” section of the Processing Toolbox to fix those with invalid geometries - this tool works by iterating through the rows in the “Invalid” output layer one after another, and producing a new layer called “Fixed geometries”. This can be merged with the existing “Valid” layer to create a layer containing all valid polygons. The Attribute Table is then cleaned up to remove any unnecessary fields. 

Once this final shapefile layer has been created to contain the valid polygons, the layer must be saved so that its .shp file can be added to our geodatabase. Subsequent updated annual analysis is uploaded to our Geospatial Dashboard available with a premium subscription –  sign up for a demo here