Confused about current state of offline basemaps

1. What is the problem? Be very detailed.

I am evaluating whether Collect can support a particular workflow for collecting offline geopoints. The goal is to use an offline raster basemap generated from private satellite imagery and to have surveyors manually place geopoints with gps assistance. It seems that a geopoint question with appearance="placement-map" might serve this purpose. After reading documentation https://docs.opendatakit.org/collect-offline-maps, trying it on multiple versions of Collect, and searching the forum, I am still confused about what I can expect to work.

From the current ODK docs, it sounds as though basemaps are always online. However, Adding Mapbox vector tile basemaps suggests that vector-based basemaps are supported using Mapbox, with limitations. I am not sure whether that implies raster is supported.

I actually have been unable to get a geopoint question with appearance placement-map to work using Mapbox (online or off). When configuring the basemap source as mapbox, I see the following:

.

Oddly, I can still select mapbox and I am still able to select an OpenMapTiles data layer loaded into the layers directory. However, the geopoint question does not display with the map widget when I tap the button. It just shows the original geopoint widget. Alternatively, if I select the Google basemap the correct widget displays, but I can not select the data layer file.

The experience is confusing because the UI seems to treat each provider fairly uniformly yet there seems to be significant differences when using the different sources. There does not seem to be enough feedback to understand what to expect or why something is failing.

2. What app or server are you using and on what device and operating system? Include version numbers.

No server, Collect 1.23.3, Collect 1.24.1 on Android 5 (API 21) on x86_64.

3. What you have you tried to fix the problem?

I am not sure what the problem is or what I can expect to work and with what provider. It just seems broken or incomplete. The docs and forum seemed to offer different versions of whether this should be possible or not.

4. What steps can we take to reproduce the problem?

It is not necessarily a defect, but it still makes sense to give the exact steps maybe? Load a single question survey containing a geopoint question with appearance="placement-map" on an emulator using Android 5 (API 21) on x86_64. Load an mbtiles file in the layers folder containing a data layer. In map settings select mapbox for the basemap source (note the error message). Select the layer file in the layer data file section. Go to fill a blank form, select the form and tap the location button. You should see the non-map gps widget. Go back to map settings, select google (note, can't select layer file now) and again try to fill a blank form. If you're online, you will see the map widget.

Mapbox is not available on x86 because analytics show very few real x86 hardware devices and shipping the required native libraries for x86 significantly increases the size of the app. I agree that it's very strange that Mapbox still gets selected and we should change that to keep the previously-selected source in case folks are using emulators as you are.

Raster offline reference layers should be supported across the board. If they are fully opaque, they should act essentially as basemaps. When you say you can't select a data layer file when Google is selected as a source, do you mean that you see a "There are no layer files..." message in the selection dialog? Are you absolutely sure that the tiles in your mbtiles file are png or jpg and not pbf (vector)? You mention OpenMapTiles which I believe is https://openmaptiles.org/. They write "Free OpenStreetMap Vector Tiles" so I expect that all of their mbtiles files have pbf tiles.

What happens if you change the basemap source to OpenStreetMap?

Edit: I now see "OpenMapTiles hosts many free map tile files that can be used in Collect" in the docs which is certainly misleading. https://github.com/klokantech/vector-tiles-sample/ has a raster mbtiles file that should work across the board.

Thank you, that explains it. I was thinking that it might be architecture related since I saw some of the discussion fly by. With your clarification, that "not supported" reads differently to me now. I understand why you avoided throwing technicals like x86 or architecture into that message, but that would have immediately clued me in that it would likely work on ARM.

Perfect, that clarifies another point for me. The basemap is still always online, but essentially your reference layer is the only one that will display when offline. So there is no "offline basemap" in that case. Am I understanding that correctly?

No, they were vector. I figured that might be the reason, but with the other "inconsistencies" (now clarified) I just was feeling like I didn't have a good sense for what was supported. The message you highlighted in your edit helped nudge me there as well.

So, in the end, it sounds like the scenario is supported using a raster reference layer, not basemap, on ARM only, not x86.

Thank you!

1 Like

That's correct if your reference layer is fully opaque or if you are offline. If you are online and have a reference layer with transparency (vector or png with transparency), the online basemap will show through.