tg icon indicating copy to clipboard operation
tg copied to clipboard

Image attachments: capture GPS coordinates from Exif data

Open 01es opened this issue 3 years ago • 0 comments

Description

Attachments could be of any supported files. However, image files, which in many practical cases originate from mobile devices, contain useful metadata. In order to take advantage of GPS coordinates, which can be present in images, entity Attachment and uploading of images as Attachment should be enhanced to capture GPS coordinates.

This information can be used at the level of TG-based application to associate domain entities with geo-locations by virtue of having images attached to them.

In addition, let's capture the date/time of when an photo was taken. This would be useful in practice, especially where photos get attached some time after they were taken. For example, if a photo of a broken fence, taken 2 months ago, is attached to a work activity, it could be important to see that the state of the fence is 2 months old.

Implementation details

  • [ ] 1. It is preferred to model the Exif data as a one-2-one association AttachmentMetadata with entity Attachment. The properties required are: latitude: BigDecimal(8,6), longitude: BigDecimal(8,6), and dateTime: DateTime (all optional). Make sure to save a new instance of AttachmentMetadata when saving a new instance of Attachment.

  • [ ] 2. Entity Attachment should have implicitly calculated property metadata: AttachmentMetadata.

  • [ ] 3. The master for Attachment should become compound, with AttachmentMetadata represented as menu item Metadata.

  • [ ] 4. Properties of Attachment.metadata should be added as selection criteria (as a subsection "Metadata") and the result set of the standard Attachment Centre.

Useful references

https://github.com/apache/commons-imaging https://github.com/apache/commons-imaging/blob/master/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java

Expected outcome

GPS coordinates for image attachments, indicating their geo-location and providing opportunity for this information to be leveraged at the application level.

01es avatar Jun 19 '22 03:06 01es