Feature request: allow export of data to file #759
gmaclennan
started this conversation in
Ideas
Replies: 1 comment
-
It looks like the URI could be satisfied by more than just the file:// provider?
I didn't look too deep, but if we could use http://, then the mapeo-mobile node
process could have an endpoint that streams out an export archive.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We would like to support a way of exporting all data (observation data + photos/media) to a file, either on the phone internal storage or a USB flash drive connected via OTG.
Android supports "Share Intents" which allow you to send files to other apps. I think one of the options you can show allows you to select a folder to save, but we need to test this. The share intent allows you to pass a URI to a local file, or pass a base64 data URL. Given the size of our exports we would need to pass the URI of a file.
Exporting just the observations should be relatively simple. We already can do GeoJSON export, and it would be good to add KML and perhaps Shapefile too, but this would need to be zipped, since a shapefile is actually several files. There are online examples of sharing an image or a PDF to other apps with this method, but I cannot confirm that we can share other filetypes like GeoJSON, we would need to check.
Exporting the images too with the share intents would be more tricky. We would need to create a zip or tarball containing all the images and the geojson. Unfortunately the share intents URI does not allow you to pass an regular URL as the file that is to be exported, you can only pass a
file://
URL. This would mean that we would need to export everything to a zip in a temp folder, and then share that, so an export would require free space 2 x the size of the export.Another option is that we export to a fixed location like
/sdcard/mapeo-mobile/export
and inform the user to look there. We know we can write to this folder from the node process.Some related links I found:
Beta Was this translation helpful? Give feedback.
All reactions