Overview
QFieldCloud provides seamless synchronization between QGIS desktop and QField mobile app, enabling field data collection with offline capabilities. The sync workflow involves packaging data for download, collecting changes in the field, and applying updates back to the master dataset.Synchronization Architecture
Three-Stage Workflow
- Package - Prepare optimized data for mobile device
- Collect - Make edits offline on QField mobile
- Synchronize - Upload changes and apply to master data
Packaging Workflow
What is Packaging?
Packaging prepares project data for offline use by:- Converting online layers to offline formats (e.g., GeoPackage)
- Optimizing file sizes
- Bundling required assets
- Configuring QField-specific settings
Package Job Model
ThePackageJob extends the base Job model:
core/models.py:2366.
Triggering a Package Job
Via API
Via QFieldSync Plugin
The QFieldSync QGIS plugin automatically triggers packaging when synchronizing.Packaging Process
- Job Creation -
PackageJobcreated with statusPENDING - Queue - Job moves to
QUEUEDwhen worker resources allocated - Execution - Worker container processes the project:
- Loads QGIS project file
- Applies offlining algorithm
- Copies required files
- Generates package files
- Completion - Status changes to
FINISHEDorFAILED
Packaging Offliners
Two packaging algorithms are available:PYTHONMINI for better performance and smaller package sizes.
See core/models.py:1087.
User-Specific Packages
Packages can be user-specific when secrets are assigned:core/models.py:1348.
Download Workflow
Package Files
Packaged files are stored separately from project files:filestorage/models.py:48.
Downloading to QField
QField mobile app:- Lists available projects via API
- Checks latest package job status
- Downloads packaged files
- Stores locally for offline use
Attachment Download Modes
Projects can configure attachment download behavior:- Reduces initial download size
- Attachments fetched only when needed
- Useful for projects with many/large attachments
core/models.py:1311.
Delta-Based Synchronization
What are Deltas?
Deltas represent individual changes made in QField:- Feature creation
- Feature modification (attribute or geometry)
- Feature deletion
Delta Creation in QField
When editing offline, QField:- Tracks all changes locally
- Creates delta objects for each edit
- Bundles deltas into a deltafile
- Uploads deltafile when online
Deltafile Format
Deltafiles are JSON documents:Upload and Apply
When QField syncs:- Upload - Deltafile POSTed to API
- Validation - Schema and permissions checked
- Storage - Individual deltas saved to database
- Apply Job - Automatic or manual delta application
core/views/deltas_views.py:67 for upload handling.
Apply Jobs
Applying Deltas
TheApplyJob processes pending deltas:
core/models.py:2403.
Automatic Apply
By default, deltas are applied automatically:core/views/deltas_views.py:152.
Manual Apply
For projects withoverwrite_conflicts=False, deltas must be applied manually after conflict resolution.
Data Synchronization Flow
Desktop to Cloud
- Create/edit QGIS project in QGIS Desktop
- Upload project files via QFieldSync plugin
- Trigger packaging job
- Wait for job completion
Cloud to Mobile
- Open QField app
- Select project to sync
- Download latest package
- Work offline with local data
Mobile to Cloud
- Make edits in QField
- Sync when online
- Deltas uploaded to cloud
- Apply job processes changes
Cloud to Desktop
- Open QGIS Desktop
- Refresh project layers
- Changes from field are visible
- Continue editing cycle
Repackaging Logic
When to Repackage
core/models.py:1645.
Cache Expiration
Online Vector Layers
Projects with online layers (PostGIS, WFS, etc.):- Cannot determine if data changed
- Always marked as needing repackaging
- Fetches fresh data on each package
core/models.py:1631.
Conflict Resolution
Conflicts occur when:- Same feature edited in multiple places
- Feature deleted locally but modified remotely
- Concurrent edits to same attributes
Automatic Conflict Resolution
Whenproject.overwrite_conflicts=True:
- Latest change wins
- No manual intervention required
- Suitable for most field data collection
Manual Conflict Resolution
Whenproject.overwrite_conflicts=False:
- Deltas marked with status
CONFLICT - Project manager must review
- Resolve through API or UI
- More control but requires oversight
Best Practices
Optimize Package Size
- Use appropriate layer types (file-based when possible)
- Limit spatial extent for large datasets
- Enable on-demand attachment download
- Configure appropriate packaging offliner
Sync Frequency
- Package when project data changes
- Field workers sync at least daily
- Monitor job status before deploying to field
- Test package downloads before critical fieldwork
Network Considerations
- QField handles intermittent connectivity
- Deltas queued locally until online
- Package downloads resumable
- Consider 3G/4G bandwidth in remote areas
Monitoring Synchronization
Job Status Tracking
- Package job completion
- Apply job status
- Error messages in
outputfield - QGIS version used
Project Timestamps
- Data was last modified
- Last successful package created
- Determine if repackaging needed
API Reference
Trigger Package Job
Check Repackaging Status
needs_repackaging field in response.
List Package Jobs
Related Resources
- Deltas - Understanding delta creation and application
- File Management - Managing project and package files
- Jobs - Job types and status codes