Modify

Opened 5 years ago

Closed 5 years ago

#10853 closed enhancement (fixed)

[patch] Save GPS image direction, use NewGpsData flag

Reported by: holgermappt Owned by: bastiK
Priority: normal Milestone:
Component: Plugin photo_geotagging Version:
Keywords: Cc:

Description

Two enhancement requests:

1) Please save the GPS image direction in addition to the other GPS data. This is the variable exifImgDir of org.openstreetmap.josm.gui.layer.geoimage.ImageEntry. Query with getExifImgDir(). The EXIF field is GPSImgDirection. Requires the second EXIF field GPSImgDirectionRef with value T.

2) Please use the ImageEntry flag isNewGpsData (query with hasNewGpsData()) to decide which photo needs to be saved. That flag was added about a year ago, rev. 6392. The idea is to have a generic "modified GPS data" indication. Until now the GPS time must be present, which is a problem if that time is unknown. The current workaround is to make up a GPS time. You could check with (e.hasNewGpsData() || e.hasGpsTime()).

I can help and write some code, if you wish.

Thanks,
Holger

Attachments (4)

photo_geotagging_10853.patch (10.7 KB) - added by holgermappt 5 years ago.
Patch file for this ticket
fullexifgps.jpg (107.5 KB) - added by holgermappt 5 years ago.
Photo with a lot of the EXIF GPS fields set
noexifgps.jpg (113.4 KB) - added by holgermappt 5 years ago.
Photo with no GPS data
exifgps.jos (1.5 KB) - added by holgermappt 5 years ago.
JOSM session file with photos and modified positions and directions

Download all attachments as: .zip

Change History (13)

comment:1 Changed 5 years ago by bastiK

Sounds good and I would appreciate some help!

Could you give some background, where the exifImgDir info comes from if not from the photo exif? Is this related to upcoming changes of the PhotoAdjustPlugin? Some example images for testing would be nice, e.g. one without GPS time, etc.

You can just commit your changes and link them in this ticket. Or attach a patch if you like to discuss it first.

comment:2 Changed 5 years ago by holgermappt

exifImgDir: I'm working on an enhancement of the PhotoAdjustPlugin that allows to set or change the image direction. Or someone could implement ticket:10235.

I will prepare example photos and attach them to this ticket. I will also prepare a patch with the code changes.

comment:3 Changed 5 years ago by holgermappt

The file modification time can be set to the GPS time, to the old file time, or to the current time. But what should happen if GPS time was selected and there is no GPS time? The closest would be the EXIF time, that's what happens now (in ImageEntry). Is that fallback acceptable?

comment:4 Changed 5 years ago by bastiK

Not sure, I would say keep the mtime as it was before in this case.

Changed 5 years ago by holgermappt

Patch file for this ticket

Changed 5 years ago by holgermappt

Attachment: fullexifgps.jpg added

Photo with a lot of the EXIF GPS fields set

Changed 5 years ago by holgermappt

Attachment: noexifgps.jpg added

Photo with no GPS data

Changed 5 years ago by holgermappt

Attachment: exifgps.jos added

JOSM session file with photos and modified positions and directions

comment:5 Changed 5 years ago by holgermappt

The patch is ready. I couldn't resist to add the speed too. The session file includes some modifications that need to be saved with the plugin (position, image direction). The photos must be in the directory where JOSM is started (relative paths in the session file). The GPS time is not set, but the isNewGpsData flag is.

There are some very long lines. I'm not sure what your maximum line length is.

comment:6 Changed 5 years ago by stoecker

Milestone: 15.01
Summary: Save GPS image direction, use NewGpsData flag[patch] Save GPS image direction, use NewGpsData flag

comment:7 Changed 5 years ago by Don-vip

Milestone: 15.01

no milestone needed for plugins :)

comment:8 Changed 5 years ago by bastiK

In [o30887]: see ​#josm10853 - Save GPS image direction, use NewGpsData? flag (patch by holgermappt)

comment:9 Changed 5 years ago by bastiK

Resolution: fixed
Status: newclosed

Looks good, thanks for the patch!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain bastiK.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.