Modify

Opened 9 years ago

Closed 9 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 9 years ago.
Patch file for this ticket
fullexifgps.jpg (107.5 KB ) - added by holgermappt 9 years ago.
Photo with a lot of the EXIF GPS fields set
noexifgps.jpg (113.4 KB ) - added by holgermappt 9 years ago.
Photo with no GPS data
exifgps.jos (1.5 KB ) - added by holgermappt 9 years ago.
JOSM session file with photos and modified positions and directions

Download all attachments as: .zip

Change History (13)

comment:1 by bastiK, 9 years ago

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 by holgermappt, 9 years ago

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 by holgermappt, 9 years ago

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 by bastiK, 9 years ago

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

by holgermappt, 9 years ago

Patch file for this ticket

by holgermappt, 9 years ago

Attachment: fullexifgps.jpg added

Photo with a lot of the EXIF GPS fields set

by holgermappt, 9 years ago

Attachment: noexifgps.jpg added

Photo with no GPS data

by holgermappt, 9 years ago

Attachment: exifgps.jos added

JOSM session file with photos and modified positions and directions

comment:5 by holgermappt, 9 years ago

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 by stoecker, 9 years ago

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

comment:7 by Don-vip, 9 years ago

Milestone: 15.01

no milestone needed for plugins :)

comment:8 by bastiK, 9 years ago

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

comment:9 by bastiK, 9 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.