We are doing fieldwork in a large area where this is no coverage. I therefore want to have base maps available in offline mode. I’m using QMetaTiles to extract tiles from e.g. google satellite. Since our area is large I generate many smaller tiles. Out of convenience I want to add them (cable transfer) to the mobile device where QField is installed and add whichever tile that is needed to my mapping project in QField. I use QFieldCloud to synchronise the project. However, I cannot use QFieldCloud to synchronise the project including basemaps as it becomes too large.
My problem is that I’m not able to find out how I can add/switch between basemaps in an existing project in QField?
Is there a limit for how large offline basemaps can be for QField to function well. I have imported a dataset (open local file > + > import dataset(s)) that is c. 280 MB and QField crashes when I try to open it in QField.
I’m using QField ver. 3.4.7.
I hope some of you might be able to put me on the right track.
thanks for you help!
Imported from GitHub discussion by @gidskela on 2025-01-14T13:50:06Z
An alternative you can try is using QField’s Shared Local Datasets feature, which allows you to have common basemaps shared across multiple projects and access them using relative paths. This way, you won’t need to keep copying the data for each project.
In my case, I copy a raster in TIFF format (~1 GB) into the basemaps folder in QField and reference it using a relative path.
You can find more details here: Shared local datasets - QField Ecosystem Documentation
Imported from GitHub comment by @lacardonap on 2025-01-14T14:08:51Z
thanks! Sounds like a good solution. However, when I try to add my path (This PC: UIB-GTG4XD3\Galaxy S22\Internal storage\Android\data\ch.opengis.qfield\files\QField\basemaps) in the Data Sources options > Localized Data Paths, I get an error message saying that the “folder name is not valid”, although I copied the path from file explorer in Windows. I can locate the folder on my Android (Galaxy) in Windows file explorer, but from within QGIS I’m not able to navigate to the folder as my Android device folder will not expand in the “choose directory” window. I therefore tried to copy it. I also tried to use foreslash instead of backslash. I get the same error message.
Imported from GitHub comment by @gidskela on 2025-01-14T14:41:30Z
I think that’s because you put an absolute path (more over with a “space” character between “Galaxy” and “S22” which is not advised) to a phone (I know that some other app is needed to deal with files on phone, at least on mac for example) rather than a relative path (relative to the project’s file location). lacardonap am I right ?
Imported from GitHub comment by @VxTedxV on 2025-01-14T15:09:21Z
The procedure I follow is as follows:
- In the QGIS project, I configure the path where the basemap is located by going to Settings > Options > Data Sources > Localized Data Paths.
- I add the basemap (e.g., a TIFF raster) to the QGIS project. This can be done via Layer > Add Layer > Add Raster Layer or by dragging and dropping the file into the project.
Note: The QGIS project does not store the absolute path. Instead, it uses the localized variable, which QField resolves to the corresponding value (/Android/data/ch.opengis.qfield/files/QField/basemaps).
-
I copy the basemap to /Android/data/ch.opengis.qfield/files/QField/basemaps.
Note: The QGIS project saves the Localized Data Paths as a variable, which QField then resolves to the corresponding value (/Android/data/ch.opengis.qfield/files/QField/basemaps).
-
Enjoy
Imported from GitHub comment by @lacardonap on 2025-01-14T17:11:26Z
Thank you so much for detailed explanation. It works perfectly!
Imported from GitHub comment by @gidskela on 2025-01-15T10:38:54Z
Anyone know if this works on iOS? When i sync to our cloud & QField it gives an invalid_dataprovider error as it cannot find the local data path i’ve set in QGIS “c:\basemaps”. Does Qfield/QFieldCloud not resolve this path to a relative path on the iOS device? (i.e. iOS Files App > QField > basemaps)
Imported from GitHub comment by @gis-kmg on 2025-04-14T04:54:43Z