QGIS usually offers several ways to do the same task: a processing algorithm, the Field Calculator, a plugin, or editing by hand. The steps in this module are examples of how to do each task, tested with the course’s sample data. They are not the only way, and other methods are equally valid as long as the outputs meet the guide’s requirements and agree with each other. Where a choice affects correctness (for example, using area($geometry) instead of $area), the module says why.
Before we begin
Section titled “Before we begin”For exercises in this module, you will use the bnhr_qgis-sflma-mapping-001.gpkg inside the data subfolder in the BNHR_QGIS-for-SFLMA-Mapping folder.
This geopackage contains all the data and projects associated with the exercises.
What we want to achieve
Section titled “What we want to achieve”- Create the area corners (point) and area boundary (polygon) shapefiles with the prescribed attributes.
- Plot the application area from a technical description, from a list of corner coordinates, and from an existing layer.
- Validate the geometry of the application area.
- Fill in the attributes following the guide’s rules.
What we have
Section titled “What we have”- bnhr_qgis-sflma-mapping-001.gpkg that contains:
- sample_td - the technical description (bearings and distances) of the sample application
- sample_tie_point - the reference point (tie point) of the sample technical description, with its coordinates and the tie line as given in the technical description (given_bearing, given_distance)
- sample_invalid - a polygon with geometry errors, for the validity exercise
- ref_barangays, ref_municipalities, and ref_provinces - reference administrative boundaries
- sample_corners.csv - the corner coordinates of the sample application
- sample_td_tie-line.txt and sample_td_boundary.txt - the sample technical description as input files for the Azimuth and Distance plugin
Relevant QGIS knowledge/skills
Section titled “Relevant QGIS knowledge/skills”- Creating a new vector layer
- Digitizing settings and snapping
- Mapping tracts of land from technical descriptions
- Loading delimited text files
- Field calculator
- Expressions
The prescribed shapefiles
Section titled “The prescribed shapefiles”- Know the attributes and data types prescribed for the area corners and area boundary shapefiles.
- Translate the prescribed data types into QGIS field types.
- Create both shapefiles in QGIS with the prescribed fields.
The guide requires two shapefiles: the tenure corners as a point layer and the tenure boundary as a polygon layer.
Area corners (point)
Section titled “Area corners (point)”| Field name | Data type | Description |
|---|---|---|
| T_CORNER | Short Integer | Precision: 0 |
| NORTHINGS | Double | Northing (Y) coordinate of the point in meters. Precision: 0 |
| EASTINGS | Double | Easting (X) coordinate of the point in meters. Precision: 0 |
| X | Double | Precision: 0. Must be left blank |
| Y | Double | Precision: 0. Must be left blank |
| NAME | Text | Name of applicant, do not abbreviate. Length: 255 |
| TENURE | Text | Name of tenure, do not abbreviate |
| REGION | Text | Region, in Roman numerals. Length: 50 |
| PROVINCE | Text | Province, do not abbreviate. Length: 255 |
| MUNI_CTY | Text | Municipality/City, do not abbreviate. If two or more, alphabetize and use only a comma as separator. Length: 255 |
| BARANGAY | Text | Barangay, do not abbreviate. If two or more, alphabetize and use only a comma as separator. Length: 255 |
Area boundary (polygon)
Section titled “Area boundary (polygon)”| Field name | Data type | Remarks |
|---|---|---|
| AREA | Double | In hectares. Precision: 0 |
| NAME | Text | Name of applicant, do not abbreviate. Length: 255 |
| TENURE | Text | Name of tenure, do not abbreviate |
| REGION | Text | Region, in Roman numerals. Length: 50 |
| PROVINCE | Text | Province, do not abbreviate. Length: 255 |
| MUNI_CTY | Text | Municipality/City, do not abbreviate. If two or more, alphabetize and use only a comma as separator. Length: 255 |
| BARANGAY | Text | Barangay, do not abbreviate. If two or more, alphabetize and use only a comma as separator. Length: 255 |
Translating the prescribed types to QGIS
Section titled “Translating the prescribed types to QGIS”The guide’s data types use ArcGIS names. In the New Shapefile Layer dialog of QGIS they are:
| Guide | QGIS type | Length | Precision |
|---|---|---|---|
| Short Integer | Integer (32 bit) | 4 | |
| Double (NORTHINGS, EASTINGS, X, Y) | Decimal (double) | 20 | 3 |
| Double (AREA) | Decimal (double) | 20 | 4 |
| Text, length 255 | Text (string) | 254 | |
| Text, length 50 | Text (string) | 50 |
The shapefile format limits text fields to 254 characters. If you enter 255, QGIS silently creates the field with 254.
The guide’s own example coordinates have three decimals (millimeters, e.g. Easting: 526493.828). A precision of 3 keeps that, and it also controls how many decimals QGIS writes when you export the coordinates to CSV: with the shapefile default of 15 decimals, a northing of 1629584.143 is written as 1629584.142999999923632.
2.1. Creating the area corners and area boundary shapefiles
Section titled “2.1. Creating the area corners and area boundary shapefiles”Level: Beginner
What we want to achieve
Section titled “What we want to achieve”- Two empty shapefiles, one point and one polygon, with the prescribed fields and in the CRS of the technical description, named in the prescribed format.
- Open Layer ‣ Create Layer ‣ New Shapefile Layer….
- Create the point shapefile for the area corners:
- File name:
IV-A_SFLMA_Point_Bagong Gubat Agroforestry Cooperative.shp - Geometry type: Point
- CRS: EPSG:3123 - PRS92 / Philippines zone 3
- Remove the default id field from the Fields List.
- Add each field in the area corners table using the QGIS types: type the Name, choose the Type, set the Length and Precision, then click Add to Fields List.
- File name:

- Create the polygon shapefile for the area boundary in the same way, named
IV-A_SFLMA_Polygon_Bagong Gubat Agroforestry Cooperative.shp, with the fields in the area boundary table.

- In the Layers panel, rename the two layers area_corners and area_boundary. The expressions and the layout template in this course refer to the layers by these names.
Keep a copy of the two empty shapefiles as templates. For every new application, copy the templates and rename the files instead of recreating the fields.
Plotting the application area
Section titled “Plotting the application area”- Plot an application area from a technical description and its tie point.
- Plot an application area from a list of corner coordinates.
- Prepare an application area from an existing layer.
How you plot the area depends on what the applicant provides. All three methods end in the same place: a closed polygon in the area boundary shapefile, in the correct CRS.
2.2. Plotting the area from a technical description
Section titled “2.2. Plotting the area from a technical description”Level: Beginner
What we want to achieve
Section titled “What we want to achieve”- The boundary of the sample application plotted from its bearings and distances, starting from the tie point.
What we have
Section titled “What we have”- sample_td_tie-line.txt - the tie point’s coordinates and the tie line, as input for the Azimuth and Distance plugin
- sample_td_boundary.txt - the nine lines of the technical description, from corner 1 back to corner 1
Review Mapping land parcels with the Azimuth and Distance plugin if you have not used the plugin before. The input files look like this:
angle=Bearingheading=Coordinate_Systemdist_units=Defaultangle_unit=degreesurvey=Polygonal[data]S 70° 48' 03" E;186.90;90S 52° 40' 51" E;223.86;90...N 59° 19' 00" E;182.83;90- Open the plugin (Plugins ‣ Topography ‣ Azimuth and distance). In the Drawing tab, click Import and open sample_td_tie-line.txt. The starting point becomes the tie point, and the tie line runs to corner 1.

- Click Use Last Vertex. The starting point moves to the end of the tie line: corner 1.
- Click Import again and open sample_td_boundary.txt. The preview shows the nine lines of the boundary.

The last line should return to corner 1. For the sample, it misses by 4.9 millimeters, because the bearings are rounded to the second and the distances to the centimeter. What would a miss of several meters tell you? We will measure this properly in Cross-validation and quality control.
- Select the last line (9-1) in the Segment List and click Remove. A polygon closes itself back to its first point, so keeping the closing line would add a tenth corner 4.9 mm away from corner 1.
- Select area_boundary in the Layers panel, choose Active Layer in the plugin, and click Draw.

- Save your edits (
). The area boundary now has exactly nine corners.

2.3. Plotting the area from a list of corner coordinates
Section titled “2.3. Plotting the area from a list of corner coordinates”Level: Beginner
What we want to achieve
Section titled “What we want to achieve”- The boundary of the sample application created from a CSV of corner coordinates.
What we have
Section titled “What we have”- sample_corners.csv - the corner numbers, eastings, and northings of the sample application
- Open Layer ‣ Add Layer ‣ Add Delimited Text Layer… and choose sample_corners.csv. Under Geometry Definition, choose Point coordinates, set X field to EASTINGS and Y field to NORTHINGS, and set the Geometry CRS to EPSG:3123.

- Connect the corners in order with Processing Toolbox ‣ Points to path: check Create closed paths and set the Order expression to T_CORNER.

- Convert the path into a polygon with Processing Toolbox ‣ Lines to polygons.

- Copy the polygon (Edit ‣ Copy Features) and paste it into the area boundary shapefile (Edit ‣ Paste Features).
2.4. Preparing the area from an existing layer
Section titled “2.4. Preparing the area from an existing layer”Level: Intermediate
What we want to achieve
Section titled “What we want to achieve”- An application area digitized or edited against reference layers, with clean, snapped vertices.
- Enable snapping in the Snapping Toolbar: snap to vertices and segments of all layers, with a tolerance of about 12 pixels.

- Toggle editing on the area boundary shapefile and digitize the area with the Add Polygon Feature tool (
), tracing shared boundaries where appropriate. - Use the Advanced Digitizing Panel to enter exact bearings and distances where the boundary follows a surveyed line.
- Save your edits (
).
Validating the geometry
Section titled “Validating the geometry”- Detect geometry errors before computing anything from the polygon.
- Fix them without changing the shape of the application area.
An invalid polygon gives a wrong area and a wrong technical description, so validation comes before any computation.
2.5. Checking and fixing the application area
Section titled “2.5. Checking and fixing the application area”Level: Beginner
What we have
Section titled “What we have”- sample_invalid - the sample boundary with two corners swapped (so the boundary crosses itself) and one corner entered twice
- Run Processing Toolbox ‣ Check validity on sample_invalid with the GEOS method.

- The Error output layer marks where the boundary crosses itself.

- Fix the error with the Vertex Tool by moving the swapped corners back into order, and delete the repeated corner. Run Check validity again until the polygon is valid.
- Check that the polygon has the same number of corners as the technical description.
Processing Toolbox ‣ Fix geometries makes the sample valid by splitting it into two parts at the crossing. The result is valid, but it is no longer the application area. Fix boundary errors by hand, against the technical description.
Filling in the attributes
Section titled “Filling in the attributes”- Apply the guide’s rules for names, regions, and multiple municipalities or barangays.
- Compute the area in hectares from the polygon.
- Derive location attributes from reference layers.
Rules for attribute values
Section titled “Rules for attribute values”- Do not abbreviate names of the applicant, tenure, province, municipality/city, or barangay.
- Write the region in Roman numerals.
- If the area covers two or more municipalities/cities or barangays, list them alphabetically, separated only by a comma.
- Leave X and Y blank in the area corners shapefile.
2.6. Computing the area and location attributes
Section titled “2.6. Computing the area and location attributes”Level: Intermediate
What we want to achieve
Section titled “What we want to achieve”- A filled-in area boundary attribute table, with AREA computed in hectares and the location fields derived from the reference layers.
- Open the Field Calculator (
) on area_boundary, check Update existing field, choose AREA, and enter:
area($geometry) / 10000
$area computes the area on the project’s ellipsoid, while area($geometry) computes it on the national grid, the same plane as the technical description’s coordinates. For the sample application, $area gives 237,587.16 m² and area($geometry) gives 237,585.24 m²: a difference in the fourth decimal of the hectares. Use area($geometry) so the area agrees with the corner coordinates and the technical description.
- Update BARANGAY with the barangays the polygon overlaps, sorted alphabetically and joined with a comma:
array_to_string(array_sort(array_distinct(overlay_intersects('ref_barangays', "barangay", min_overlap:=1))), ',')
min_overlap:=1 ignores barangays that only touch the application area along its edge, or overlap it by less than one square meter.
- Update MUNI_CTY and PROVINCE in the same way, using the muni_city and province fields of ref_barangays:
array_to_string(array_sort(array_distinct(overlay_intersects('ref_barangays', "muni_city", min_overlap:=1))), ',')array_to_string(array_sort(array_distinct(overlay_intersects('ref_barangays', "province", min_overlap:=1))), ',')- Fill in NAME (
'Bagong Gubat Agroforestry Cooperative'), TENURE ('Sustainable Forest Land Management Agreement'), and REGION ('IV-A'), then save your edits.

AREA is a Double, in hectares, and the field’s precision of 4 keeps it to four decimals. Sample maps in circulation show areas with two to six decimal places. Confirm with your reviewing office how many decimal places AREA should carry, and change the 4 in the field’s precision and in the map’s area label accordingly.
Multiple parcels
Section titled “Multiple parcels”If the application involves multiple parcels:
- put all parcels in one polygon shapefile, one feature per parcel, and
- create one point shapefile per parcel, each with its own corner numbering.
Quizzes
- Check-inAt the end of the module. A short check on “Preparing the area data”, and how ready you feel; its answers show as soon as you submit.Check-in: Preparing the area data ↗
The quizzes are on BNHR Quizzes and count toward nothing. Learning on your own, a quiz opens as the self-paced one; while a training runs, it asks which training you are in.