Hello, I am desperately trying to use QField’s basemaps directory to share raster files that are common to several projects. It works maybe one time out of a hundred, but most of the time it doesn’t. Does anyone have a clear procedure or tutorial on this topic? Thank you in advance for your help.
Yan
Hello, is there a particular reason you are trying to share rasters that way?
There already is a functionality to share common data for multiple proyects in a qfield compatible way, they are called “shared datasets”. You can check this page on the documentation to learn more. It works not only for rasters, but for vector too.
At the very least, it would be a more clear and standard way of doing what seems to be the same thing. “Basemap” is generally used to only refer to a single, bottom raster layer with a XYZ tile structure/format.
Hello Cuprico.
Yes, indeed, the term basemaps can be confusing. By basemaps, I don’t mean configuring a background map through Project Properties > Base map, but rather placing rasters in QField’s basemaps folder on my phone so they can be shared across several projects. What I’m trying to do is save storage space on my team’s phones and ensure that fairly heavy maps can be available outside GSM coverage areas. The documentation available for QField used to be more explicit about cable transfers and project configuration via QField Sync. It seems to me that in QGIS, in addition to setting the link in Preferences > Options > Data Sources > Localized Data Paths, you also had to process the raster through Project Properties > Cable Export using ‘remove from project’.
Ah! I misinterpreted your initial post, thanks for clarifying. Didn’t paid enough attention, I now see that you said the basemaps folder. It is indeed a weird choice of words, but I digress.
Just did a small test right now, in case the problem might be related with a recent change. What I did was:
-
Created a project as usual in a random folder on my computer. It has a simple Geopackage and a OpenStreetMap layer as background.
-
Configured desktop QGIS to add a Localized Data Path as the page suggest, on my user folder on linux, on
~/gis-common. -
Copied some random geotiff I had directly on the
~/gis-commonfolder. -
Dragged that geotiff on the
~/gis-commonfolder into the QGIS window with my project opened. On theLayerspanel it says that it is located in/home/user/gis-common/file1.tiff -
Went to
Plugins>QfieldSync>Configure Current Project. Then on theCable Packagingtab I’ve set the layers I want to edit asOffline editing, while the OpenStreetMap and raster layer where set asDirectly access as data source. -
Use the
Package for QFieldbutton of the QFieldSync plugin. It warns me that I’m using a shared file:
This created a new folder populated with some files on~/QField/export/test. There are no signs of the geotiff on this new folder. -
I plug the phone to the computer.
-
Copied the “shared file”
file1.tiffonto phone > Android > data > ch.opengis.qfield > files > QField > basemaps. -
Copied the folder
~/QField/export/testinto/Android/data/ch.opengis.qfield/files/QField/basemaps/on my phone.
I then opened the project on my phone and it worked ok, I can see all the layers, including the raster.
Let me know if this is more or less what you are trying to do or if you need something more complex.
