geopaparazzi / smash

Source code of the SMASH Android/iOS digital field mapping app.
https://www.geopaparazzi.org/smash/index.html
GNU General Public License v3.0
73 stars 26 forks source link

Images table in gpkg is missing records #276

Closed AndrewM- closed 1 month ago

AndrewM- commented 1 month ago

If I use dbeaver to open a gpap file directly, I can see all of the records in the images table. However, if I export to a geopackage, I can only see the first record. See screen clips below.

Geopackage 2024-08-15 13_25_04-DBeaver Enterprise 23 0 0 - images

GPAP 2024-08-15 13_22_13-DBeaver Enterprise 23 0 0 - images

I have written a python script that exports the notes to html and noticed that I my code was not returning the file names. On investigation it seems like the export geopackage function has an issue. I don't need the image data, but do need the file names.

AndrewM- commented 1 month ago

Version 1.9.1 which is the current iOS version. I am using iOS. Data and photos collected using json forms which I have developed.

moovida commented 1 month ago

Hi @AndrewM- thanks for reporting this.

Would it be possible to get from you one such gpap project that upon geopackage export misses some images. That would help me debug the issue right away.

AndrewM- commented 1 month ago

Hi Moovida, I will collect a new dataset and upload it. I want to be sure that the issue is reproducible.

AndrewM- commented 1 month ago

carparks.zip Here is a new gpap and exported geopackage file. It seems that all images taken within user-forms fail to export from gpap to geopackage. I deleted the image data table from the gpap file, to bring the size of the zip file down.

moovida commented 1 month ago

Ok, will give it a try with a form with just one image form.

moovida commented 1 month ago

Wow, I just found out that exporting of forms never did work. It was thought more for simple image notes and never upgraded to support forms. I guess this is kind of similar to the export to image folder. But while that one was rather simple to fix, this is a bit more complex, because the images need to be linked to their parent note. I will need to think about how to fix this.

moovida commented 1 month ago

@AndrewM- , I wonder what your usecase is. Will you be able to stitch together the form with its image id?

Because I think it kind of just boils down to that.

moovida commented 1 month ago

Ok, I fixed this by exporting the images of forms also. The ids are correct. If there are issue feel free to reopen this.

AndrewM- commented 1 month ago

@moovida The use case is printing the forms out as a html document, which can be converted into a pdf by LibreOffice. A test file is attached. Smash is can be used for environmental auditing where the output is a document. In this use case, I can bypass the GIS entirely. If I export the images as files and copy the folder of images to my local hard drive, then I can use the python code to create a web page which shows my field data in document format. I can get file name for images using SQL. The pdf below comes from a version of the script which uses the GPAP file and exported images. Carparks.pdf

moovida commented 1 month ago

Ah, that is quite cool.

I have pushed a fdroid update, let's see when it is realeased. In case you can always thest the apk on the releases page.