TITLE: Lagash Archaeological Survey and Recording System (LASRS) - Importing ArcGIS Field Maps Data to QGIS 
AUTHORS: Paul C. Zimmerman

[DESCRIPTION]
This protocol describes how data collected with ArcGIS Field Maps, using forms generated according to the Rectangular Survey Grid Creation with QGIS and Creating Collection Forms with ArcGIS Field Maps protocols, can be imported into QGIS and combined with tabular data of the collected artifacts (such as counts and weights) for further analyses such as the creation of heat maps.


 

 


[STEPS]
SECTION: Export the Targets Shapefile from ArcGIS Field Maps
1. Log into your ArcGIS Online account with the web browser of your choice.
SECTION: Export Observations Recorded with ArcGIS Field Maps
5. Click on Content in the page header, navigate to where your Observations feature layer is stored, and click on its name.
SECTION: Export Observations Recorded with ArcGIS Field Maps
6. On the right, choose Export Data > Export to CSV File, then click the Export button.
SECTION: Export Observations Recorded with ArcGIS Field Maps
7. When the export file is created the page will refresh. Click the Download button on the right to download a zip file which will contain the data in the Samples and Notes layers.
SECTION: Export the Targets Shapefile from ArcGIS Field Maps
2. Click on Content in the page header, navigate to where your Targets shapefile is stored, and click on its name.
SECTION: Export the Targets Shapefile from ArcGIS Field Maps
3. Click the Download button on the right to download a zip file which will contain the components of the Targets shapefile.
SECTION: Export the Targets Shapefile from ArcGIS Field Maps
4. Locate the Archive.zip file on your computer (probably in the Downloads folder) and rename it to Targets.zip.

 

SECTION: Export Observations Recorded with ArcGIS Field Maps
8. Locate the zip file on your computer (probably in the Downloads folder) and expand it. The expanded folder should have two CSV files within it: Notes_1.csv and Samples_0.csv.
SECTION: Import the Targets Shapefile into QGIS
10. In QGIS select Layer > Add Layer > Add Vector Layer…
SECTION: Import the Targets Shapefile into QGIS
11. Click the three dots button to the right of the Vector Dataset(s) field, locate the Targets.zip file, and click the Add button.
SECTION: Import the Targets Shapefile into QGIS
12. Find the Targets — Survey Grid.shp layer on the left, and rename it to Targets.

 

SECTION: Import the Targets Shapefile into QGIS
9. Launch QGIS and open a project or create a new one. Make sure that the project CRS indicated in the lower right corner of the QGIS window shows the correct EPSG code.

SECTION: Import the Observations CSV into QGIS
13. in QGIS select Layer > Add Layer > Add Delimited Text Layer…
SECTION: Import the Observations CSV into QGIS
14. Click the three dots button to the right of the File name field and locate the Samples_0.csv file.
SECTION: Import the Observations CSV into QGIS
15. If necessary, expand the Geometry Definition panel. Make sure that Point coordinates is selected and that the X and Y fields are mapped properly. Change the Geometry CRS to EPSG:4326 - WGS 84, then click the Add button.

  
 

SECTION: Import the Collections and Measurements CSV into QGIS
16. Processing of the collections should result in well-formed tabular data that can be exported as a CSV. Each line in the CSV should have the data from a single Positive sample. One column in the table must have the target name, spelled exactly as the nodes are in the Targets layer, and each subsequent column must contain one discrete measurement.

The method by which collections can be processed is beyond this protocol. For LAP, we used a bespoke data collection form using Wildnote that prompted for counts and weights of certain classes of objects (e.g., counts and weights of simple pottery sherds and ceramic slag pieces). If the stability of your internet connection is sufficient, then a similar form can be generated with Google Forms. Direct entry into a spreadsheet or database is also possible, but the end result must be a well-formed table as described above. Note, however, that only Positive samples need to be recorded in the CSV file; Negatives and Write-Offs can be omitted.
SECTION: Import the Collections and Measurements CSV into QGIS
17. in QGIS select Layer > Add Layer > Add Delimited Text Layer…
SECTION: Import the Collections and Measurements CSV into QGIS
18. Click the three dots button to the right of the File name field and locate the CSV file with the processed collections.
SECTION: Import the Collections and Measurements CSV into QGIS
19. In the Geometry Definition panel select No geometry (attribute only table). In the Sample Data panel, verify that the data type for each column is correct, then click the Add button.
SECTION: Import the Collections and Measurements CSV into QGIS
20. Find the newly-added geometry-less layer on the left and rename it to Collections_0.
SECTION: Join the Layers into a New Layer with All the Survey Data
21. If the QGIS Processing Toolbox isn’t visible, show it by selecting View > Panels > Processing Toolbox.
SECTION: Join the Layers into a New Layer with All the Survey Data
22. In the Search field of the Processing Toolbox, type join and double-click Join attributes by nearest.
SECTION: Join the Layers into a New Layer with All the Survey Data
23. In the Join attributes by nearest window, set Input layer to Samples_0 and Input layer 2 to Targets, then click the Run button.
SECTION: Join the Layers into a New Layer with All the Survey Data
25. In the Processing Toolbox, double-click Join attributes by field value.
SECTION: Join the Layers into a New Layer with All the Survey Data
26. In the Join attributes by field value window, set Input layer to Joined Layer_0 and Table field to node. Set Input layer 2 to Collections_0 and Table field to target (or whatever the node name field is), then click the Run button.

 

SECTION: Join the Layers into a New Layer with All the Survey Data
24. Rename the newly-created layer to Joined layer_0.
SECTION: Join the Layers into a New Layer with All the Survey Data
27. Right-click on the newly-created Joined layer (not Joined layer_0) and select Export > Save Features As…
SECTION: Join the Layers into a New Layer with All the Survey Data
28. In the Save Vector Layer as… window set Format to GeoPackage. Click the three dots button next to the File name field and choose where you want to save the new file with the name Samples. Change the Layer name to Raw Measurements. Set the CRS to the project CRS, and then click the OK button.

 

SECTION: Join the Layers into a New Layer with All the Survey Data
29. Remove the Samples_0, Collections_0, Joined layer_0, and Joined layer layers, then save your QGIS project.
SECTION: Style the Samples — Raw Measurements Layer
30. Download the following QGIS style file:   

SECTION: Next Steps
35. The result of the above steps is a map showing the status of each target’s collection with differently colored dots. It also preserves the location of each sample, as recorded in ArcGIS Field Maps, and the measurements for each collection as attributes of each point. The data from those attributes can be used as weights for creating contours or heat maps in QGIS. New attributes, created formulaically from the existing data can be created and also used as the basis for such visualizations. However, if modifications will be made to the data, it is recommended that you do so to copies of the Samples — Raw Measurements file (created via export), rather than to the source file.

 

SECTION: Style the Samples — Raw Measurements Layer
31. Double-click the Samples — Raw Measurements layer to open its properties window.
SECTION: Style the Samples — Raw Measurements Layer
32. Click the Style button at the bottom of the Layer Properties window and select Load Style…
SECTION: Style the Samples — Raw Measurements Layer
33. Click the three dots button to the right of the File field and select the styles file downloaded in step 30, then click the Load Style button.
SECTION: Style the Samples — Raw Measurements Layer
34. Click the OK button to apply the style and close the Layer Properties window.