
In this webinar, get an exclusive look at how data, research and analytics firm Laterite used SurveyCTO to gather geospatial data for the Rainforest Alliance in the San Martin region of the Peruvian Amazon rainforest.
Research Analyst Nicole Linares and Research Associate Ricardo Vargas take you behind the scenes of this project to explain how MBTiles and QGIS is used in conjunction with SurveyCTO let their team collect precise land boundaries of cocoa and coffee farms.
The team at Laterite has also put together a written resource below to guide teams that want to implement this technique in their workflows.
Key Webinar Takeaways
- How using MBTiles can facilitate offline geospatial data collection
- How to use QGIS to create MBTiles files
- How to collect GPS data using the geoshape function in SurveyCTO!
Time Stamps
4:51 – MBTiles overview
9:49 – QGIS overview
10:19 – How to load the base map satellite imagery layer into QGIS
10:51 – How to import a specific geographical location onto the base map
11:40 – How to generate the MBTiles file in QGIS (including best practices for balancing map resolution and file size)
16:25 – How to upload the MBTiles file into mobile devices for use
19:25 – How to collect GPS data using geoshape function in SurveyCTO Collect
Technical Guide: Generating and Using Offline Satellite Maps (MBTiles) for Spatial Data Collection
Introduction
This guide summarizes the workflow presented in the webinar “Offline Satellite Maps (MBTiles) for Spatial Data Collection.”
The document outlines the rationale for using MBTiles in low-connectivity settings, the technical steps to generate offline satellite maps using QGIS, the configuration required in SurveyCTO, and the validation logic used to assess polygon accuracy during data collection.
The methodology presented here is based on a real project implemented in the San Martín region of Peru, where field teams needed access to high-resolution satellite imagery to delineate agricultural parcels located in areas with limited or no internet connectivity.
Background and Problem Definition
Spatial data collection in agricultural and environmental surveys often requires capturing the boundaries of land parcels. For small areas, enumerators can walk the perimeter; however, in many rural contexts plots may be 5, 10, or even 20 hectares, or may be covered by dense vegetation. Under these conditions, physically navigating the entire boundary is not feasible.
Satellite imagery becomes essential for accurately tracing plot limits. Yet, in remote areas—such as the districts of Moyobamba, Soritor, and others involved in our project—mobile data coverage is limited or nonexistent.
This constraint led to a central operational question:
How can high-resolution satellite imagery be made available offline within SurveyCTO during fieldwork?
The solution adopted involved generating MBTiles using QGIS and integrating them into SurveyCTO Collect through a structured offline workflow.
What MBTiles Are and Why They Matter
MBTiles is a file format designed to store tiled map data efficiently. Instead of saving a large raster image, the format organizes the map into hundreds or thousands of smaller “tiles,” each representing a segment of the map at a specific zoom level. This tiling system allows maps to load rapidly, even on devices with limited processing capacity.
Three features make MBTiles particularly useful for field data collection:
- Offline accessibility: The entire tileset is stored locally on the device, enabling enumerators to view high-resolution basemaps without an internet connection.
- Performance efficiency: Because SurveyCTO loads only the tiles corresponding to the current view and zoom level, navigation remains smooth in the field.
- File size optimization: Even detailed basemaps remain lightweight relative to large raster files.
In practice, MBTiles allow enumerators to visualize satellite imagery directly within SurveyCTO when drawing geoshapes, providing the spatial context needed to trace agricultural parcels accurately.
Overview of the Workflow
The full workflow involves five steps:
- Preparing the satellite basemap in QGIS.
- Generating the MBTiles file using raster tools.
- Transferring the MBTiles file to the tablet.
- Configuring the offline layer inside SurveyCTO Collect.
- Drawing polygons and validating plot area during data collection.
The following sections describe each step in detail.
- First Step: Preparing the Base Layer in QGIS
We begin by opening QGIS, an open-source environment for processing geospatial data. QGIS is well-suited for generating MBTiles due to its flexibility, open-source license, and compatibility with SurveyCTO’s offline mapping functions.
- Loading the Satellite Imagery
Satellite basemaps were obtained using the QuickMapServices plugin. The recommended layer is Google Satellite Hybrid, which combines high-resolution imagery with contextual reference features such as roads and place names.
Figure 1: Satellite Basemap Layer – Google Hybrid Satellite
b. Importing the District Shapefile
A district boundary shapefile (e.g., Moyobamba district) is imported to delimit the geographic area for which the MBTiles will be generated. Clipping the basemap to the area of interest early significantly reduces processing time and prevents unnecessarily large output files.
Once both layers are loaded—the basemap and the district polygon—the workspace is ready for generating MBTiles.
Figure 2: Moyobamba and Basemap Layer
- Second Step: Generating MBTiles in QGIS
In QGIS, MBTiles are produced using the tool:
Processing Toolbox → Raster Tools → Generate XYZ Tiles (MBTiles)
The following parameters were used in the project, but it is important to test the adequate parameter for each project, particularly the zoom level.:
- Extent: District polygon
- Zoom levels: Minimum = 19, Maximum = 19
- Tile format: JPG
- Quality: 75
- DPI: 96
- Antialiasing: OFF
Before running the tool, the district boundary layer must be unchecked to prevent the outline from being burned into the final imagery.
- Rationale for Key Parameters:
Extent (District polygon):
Clipping to the district reduces file size and ensures the MBTiles cover only the required study area.
Zoom level 19:
Provides sufficient detail to distinguish plot boundaries for parcels of one hectare or larger. Using a single zoom level keeps the file compact and improves loading performance in SurveyCTO.
Projects with different parcel sizes or study needs may select alternative zoom levels.
More zoom level generate MBTiles with more details but increase the size of the file exponentially.
Tile format (JPG) and Quality (75):
JPG balances clarity and file size, making it optimal for satellite imagery. A quality of 75 preserves sufficient detail while minimizing storage demands.
DPI (96):
Standard for web-based maps; higher values do not improve clarity on mobile screens.
Antialiasing (OFF):
Disabling antialiasing reduces processing time without compromising imagery quality for field use.
Running the tool produces a single *.mbtiles file ready for transfer to field devices.
Figure 3: Raster Tools Parameters
- Third Step: Loading MBTiles into SurveyCTO
SurveyCTO requires a specific folder structure to recognize offline basemap files. Each MBTiles file must be stored inside its own folder.
- Required Directory Structure
Android > data > com.surveycto.collect.android > files > layers > [LayerName] > yourfile.mbtiles
Key rules:
- Create a new folder inside layers for each offline map.
- The folder name becomes the layer name visible inside SurveyCTO Collect.
- Only one MBTiles file may be stored per folder.
- Multiple offline maps require multiple folders.
If the file is not placed inside a folder, SurveyCTO will not detect it.
- Fourth Step: Using Offline MBTiles During Data Collection
Once the file is correctly transferred, enumerators can access the offline layer directly within the survey form.
- Opening the Map Interface
During the geoshape question SurveyCTO opens the map interface.
In the top-right corner, the “layers” icon displays the list of available basemaps, including the offline layers stored in the device.
Selecting the appropriate folder name (e.g., Moyobamba_final) loads the offline satellite imagery instantly.
Figure 4: Select Offline Layer in SurveyCTO Collect App
b. Drawing the Polygon
Enumerators place vertices along visible plot boundaries and zoom in as needed. Zoom level 19 provides enough detail to support accurate polygon tracing.
Once complete, the polygon is saved, and SurveyCTO automatically records its geometry.
Figure 5: Polygon in SurveyCTO
- Fifth Step: Automatic Area Calculation and Validation
SurveyCTO computes the area of the polygon using the built-in area() function.
The workflow implemented in the project included:
- SurveyCTO calculates the polygon area in square meters with the calculate function area(${Geoshape_variable})
- The value is converted to hectares by dividing by 10,000 with the calculate function ${area_m2} div 10000
- The form compares the polygon-derived area with the area declared by the farmer with the calculate function ${declare_value } – ${area_ha}
- A validation threshold of 1 hectare determines whether the polygon is acceptable, this is done with the relevant expression: abs(${diference_round}) >= 1 This parameter in context specific and might need to be changed according to each project
If the difference exceeds 1 ha, the enumerator is prompted to redraw.
If the difference is below the threshold, the survey proceeds.
This threshold was appropriate for parcels in San Martín but should be adjusted for the characteristics of each project.
Figure 6: Example message when the difference is less than 1 hectare
This setup ensures that data validation occurs directly in the field, reducing inconsistencies and improving accuracy.
Summary of the Workflow
The complete process can be summarized in five steps:
- Load a satellite basemap and the district shapefile in QGIS.
- Generate an MBTiles file using appropriate parameters for resolution and performance.
- Transfer the file to the tablet following SurveyCTO’s required folder structure.
- Select the offline layer inside SurveyCTO Collect.
- Draw the polygon and validate the area using the built-in geoshape and area calculation functions.
Together, these steps enable high-quality spatial data collection in low-connectivity environments while maintaining strong data quality controls.
Closing
The MBTiles workflow has proven highly effective for supporting field teams in remote agricultural zones. By combining QGIS processing, structured offline configuration, and automated validation within SurveyCTO, teams can capture accurate plot boundaries even without internet access.
For additional questions about QGIS processing, MBTiles configuration, SurveyCTO setup, or the area validation logic, please reach out to the project team at Laterite.
New to SurveyCTO? Sign up for a free trial today to explore our solution. During the 15-day trial, you’ll have access to the entire platform.
If you need help now, our support team is available 24×7. Go to the Support Center and click on the link to “Submit a support request.” No question is too small!