Aug 15, 2023

Public workspaceLagash Archaeological Survey and Recording System (LASRS) - Rectangular Survey Grid Creation with QGIS

  • 1Penn Museum
Icon indicating open access to content
QR code linking to this content
Protocol CitationPaul C. Zimmerman 2023. Lagash Archaeological Survey and Recording System (LASRS) - Rectangular Survey Grid Creation with QGIS. protocols.io https://dx.doi.org/10.17504/protocols.io.bp2l69r3klqe/v1
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: February 02, 2023
Last Modified: August 15, 2023
Protocol Integer ID: 76296
Keywords: Archaeology, Survey, GIS
Abstract
Tools available in the open-source GIS program QGIS can be used to create a rectangular grid for archaeological surveys within irregularly-shaped boundaries. This protocol describes the steps necessary for generating the grid, trimming it to the desired survey area, and uniquely labeling the nodes generated.
Materials
This protocol was developed with QGIS 3.28, but earlier and later versions should function similarly (though perhaps with minor differences in the QGIS interface).
Create Your QGIS Project
Create Your QGIS Project
Launch QGIS and select the New Empty Project template.
Click the project CRS button in the lower right of the window and select the appropriate EPSG with UTM coordinates for your survey.

  • For most of Iraq, this will be WGS 84 / UTM zone 38N (EPSG:32638).
Download background imagery.
Locate the QuickMapServices button in the QGIS toolbar.
Note
If the QuickMapServices button isn’t in the QGIS toolbar, install it with the QGIS Plugin Manager.
  1. Next, click the QuickMapServices button and choose Settings to open the QuickMapServices settings window.
  2. In the QuickMapServices settings window, switch to the More Services panel and click the Get contributed pack button.

Click the QuickMapServices button in the QGIS toolbar and choose the appropriate background map for your survey.
Note
For Southern Iraq, Bing Satellite is usually the best.

Save your QGIS project before proceeding.
Define the Survey Area
Define the Survey Area
Zoom to your survey area.
Create a new shapefile layer.
Choose Layer > Create Layer > New Shapefile Layer… to open the New Shapefile Layer window.
Next to the File name field click the three dots button to choose the location where the new file will be saved. Name the new shapefile something sensible like Site Boundary or Survey Area.
From the Geometry type menu choose Polygon.
Verify that the CRS shown is the same as the project CRS, correcting this if it’s different.
Click OK to create the new layer.

Draw the outline of your study area.
In the Layers panel, double-click the newly-created polygon layer to open its Properties window.
Select the Symbology panel and click on the Simple Fill symbol layer.
From the Symbol layer type menu choose Outline: Simple Line.
Change the line color and stroke width to values that will show clearly on your background imagery.
Click the Toggle Editing (pencil) button then the Add Polygon Feature button.

Left-click to place vertices that define the polygon bounding the survey area. Use the scroll wheel on your mouse to zoom in and out as necessary and the spacebar to pan. When finished, right-click to finish the polygon.
When it pops up, dismiss the Feature Attributes window by clicking OK, leaving the id null.
If necessary, use the Vertex Tool edit the newly-created survey boundary polygon by moving, adding, or removing its vertices.
Click the Toggle Editing button, and save your changes.


Save your QGIS project before proceeding.

Final result of steps 5–8.

Generate the Unlabeled Survey Grid
Generate the Unlabeled Survey Grid
Create the base grid
Choose Vector > Geometry Tools > Centroids… to open the Centroids algorithm settings.
Set the Input Layer to the layer created in steps 5–9.
Leave the other values at their defaults and click the Run button.
Use the Identify Features tool to get the coordinates of the centroid that you just created. Write these values down separately, as you will need to refer to them again later.




Use the Measure Line tool to find the distance from the centroid to the furthest edge of the survey area boundary created in steps 5–9. This measurement doesn’t have to be exact, so round up to be sure that the entire boundary falls within the distance measured.


Note
In the example shown below, with Lagash as the site, I measure roughly 2050 meters from the centroid to the farthest northwest corner of the site boundary. I will round this number up to 2200 for the next step.


Choose Vector > Geoprocessing Tools > Buffer to open the Buffer algorithm settings.
Set the Input Layer to the Centroids layer.
Set the Distance to the value determined in step 10.5.
Leave the other values at their defaults and click the Run button.
Choose Vector > Research Tools > Create Grid… to open the Create Grid algorithm settings.
Leave Grid type at Point.
Set the Grid extent by clicking the down arrow > Calculate from Layer > Buffered

Set Horizontal spacing and Vertical spacing to the intended spacing of your survey grid.

Set the Grid CRS to the same value as the project CRS.
Leave the other values at their defaults and click the Run button.
In the Layers pane, right-click on the newly-created Grid layer and select Open Attribute Table.
Click the Toggle editing mode (pencil) button in the upper left of the Attribute Table window to enable editing.
Click the Open field calculator (abacus) button to open the Field Calculator window.
Make sure that the Only update n selected feature(s) option is unchecked and that Create a new field is checked.
Enter transect for the Output field name.
In the Expression field enter the following formula, then click the OK button.
(("left" - minimum("left")) / ceil((maximum("left") - minimum("left")) / count_distinct("left"))) + 1

Click the Toggle editing mode (pencil) button in the upper left of the Attribute Table window and then click Save to save the edits.
Rotate the grid to the alignment required by the survey.
Note
There may be reasons why a N-S aligned grid is acceptable for your survey, but even so the following steps need to be performed in order to label the grid nodes consistently.


In the Processing Toolbox find Vector geometry > Rotate and double-click it to open the Rotate algorithm settings.
Note
If the Processing Toolbox isn’t open in QGIS, open it by choosing View > Panels > Processing Toolbox.

Set the Input layer to the grid created in step 10.
Set the Rotation (degrees clockwise) field to the appropriate value plus 270.
Note
In this example, I want to rotate the grid to 22° clockwise, to match the longitudinal axis of the site of Lagash, so I will enter 292 into the Rotation (degrees clockwise) field.

Set the Rotation anchor point field to the X and Y coordinates of the centroid, as recorded in step 10.4, separated with a comma.

The example project so far, with temporary Centroids, Buffered, Grid, and Rotated layers.

Remove points that lie outside the survey area.
Choose Vector > Geoprocessing Tools > Clip… to open the Clip algorithm settings.
Set the Input layer to the rotated grid created in step 11.
Set the Overlay layer to the polygon created in step 6.
Click the Run button.
In the Layers pane, select the grid layers created in steps 10 and 11 and remove them.
Note
You may also want to uncheck the Centroids and Buffered layers in order to hide them. Don’t delete them yet, however, in case you need to create a new grid with a different spacing (see step 13, below).

In the Layers pane, right-click on the newly-created Clipped layer and select Show Feature Count to reveal the number of grid nodes within the survey area, from which you can calculate the overall coverage and make estimations of project duration, cost, or any other pertinent constraints directly influenced by the number of survey units.

Final result for steps 10–12, showing the number of grid nodes within the survey area (1740, in this example).

Repeat steps 10–12 with different grid spacings and/or rotations to achieve the objectives of the survey. When done you can remove the Centroids and Buffered layers.
Create the Labeled Survey Grid
Create the Labeled Survey Grid
In order to easily identify the grid nodes, they should be given unique labels, which will be assigned in the QGIS Attribute Table for the layer.
Note
In the example given, nodes are labeled from south to north and from west to east, starting with 1 for the southernmost row, and 1 for the westernmost node on each row. Each row is conceived of as a surveying transect, though the survey itself does not necessarily have to proceed by transects. Thus, the node labeled 50m/26-4 would be the 4th node from the west on the 26th row from the south of the 50m survey grid.

In the Layers pane, right-click on the newly-created Clipped layer and select Open Attribute Table.
Click the Toggle editing mode (pencil) button in the upper left of the Attribute Table window to enable editing.
Click the Open field calculator (abacus) button to open the Field Calculator window.
Make sure that the Only update n selected feature(s) option is unchecked and that Create a new field is checked.
Enter node for the Output field name.
Set the Output field type to Text (string).
In the Expression field enter the following formula, replacing <survey identifier> with an appropriate prefix to identify the survey being planned, and ensure that the Output field length value is sufficient to accommodate the longest expected result. Then click the OK button.
'<survey identifier>' || '/' || ("row" - minimum("row") + 1) || '-' || ("id" - minimum("id", "row") + 1)

Click the Delete field button and remove all the fields except for the newly-created node field because they are no longer useful or accurate.



Click the Toggle editing mode (pencil) button in the upper left of the Attribute Table window and then click Save to save the edits.
In the Layers pane, right-click on the Clipped layer and select Make Permanent…
From the Format menu, choose ESRI Shapefile.
Next to the File name field click the three dots button to choose the location where the new file will be saved. Name the new shapefile something sensible like Survey Grid, then click OK to save the shapefile.
In the Layers pane, right-click on the Clipped layer and select Rename Layer then type the name that you used in the previous step.

Detail of the grid generated above, with node 50m/26-4 highlighted in yellow.
Save your QGIS project.

Next Steps
Next Steps
Depending on the intended use of survey grid created, one may wish to alter the point symbology, or add labels (using the node field generated in step 14).
Finally, when you are satisfied that the grid meets the project’s needs, find the Survey Grid shapefile and zip all its components together to upload to ArcGIS Online (see the Creating Collection Forms with ArcGIS Field Maps protocol).

Note
When zipping the shapefile, be sure to include all its components: cpg, dbf, prj, shp, and shx.