Soil-Carbon-Coalition / atlasbiowork

App framework based on wq for entering georeferenced data about landscape function
4 stars 2 forks source link

saving Sites and Observations (inc. photos) for off-network use #15

Open managingwholes opened 8 years ago

managingwholes commented 8 years ago

Thinking ahead to field use, when one is doing repeated observations, having photos and site data saved on device is almost essential, as many sites will be off-network. To accurately repeat photo framing for example, and sometimes transect photos are essential in relocating transects and other observations.

Could the filesystem API be accessed through wq stack? How?

sheppard commented 8 years ago

Site data should be available offline already via the IndexedDB cache - the maps aren't working, but the data is there. I would envision storing photos in the same place (via wq/store.js), in one of two ways:

The filesystem is not easily accessible from websites due to security restrictions. You can get at the filesystem from within a PhoneGap/Cordova app, but I think we should be able to do what we need by storing Blobs and/or base64 images in IndexedDB via wq/store.js. The main benefit of the IndexedDB approach is that it works on the web and within Cordova, so we don't need separate code paths for each case. On the other hand, the FileSystem API might better match user expectations and could make integration with other native apps easier.

(For browsers that don't support IndexedDB, the localForage library that powers wq/store.js will automatically use WebSQL or localStorage, as appropriate).

managingwholes commented 8 years ago

Would be great to be able to download a few observations into some kind of Stored Observations bin, viewable on the device via the app perhaps with a read-only template, with the ability to attach child observations to them.