Skip to main content
Hi,

 

 

I have this workspace to add a geotag to a jpeg, based on a GARMIN glo GPS logger.

 

I merge the GPS data with the jpeg by the date. When I take a look at the inspector merging seems to go well. But there is no exif information in the created jpeg (no original exif info and no latitude, longitude and altitude info). Anyone can help? I am new to FME.

 

 

Best,

 

J.

 

 
Hi,

 

 

how are you merging the GPS coordinates? Are you using the RasterGeoreferencer?

 

 

David
I use a FeatureMerger, the join is based on the date/time. I want the GPS coordinates into the exif of my jpeg
I get X,Y,Z coordinates with a CoordinateExtractor from a shp with all GPS locations. I merge them with the jpeg based on the date/hour. So I want the coordinates in e.g. jpeg_exif_latitude jpeg_exif_longitude and jpeg_exif_altitude. But all exif information is lost in the created jpeg writer, even the camera model (Nikon D5300) and date of creation, ...
Hi,

 

 

looking at the JPG writer I actually start wondering if it supports writing the lat/lon coordinates. Maybe you should contact Safe support to verify this.

 

 

In the meantime, maybe this can help? http://geotag.sourceforge.net/

 

 

David
According to the blog by Mark the Evangelist on fme2014 release it does.

 

 

Maybe you need to set the relevant metadata attributes?

 

 

http://blog.safe.com/2014/02/fmeevangelist123/

 

 
Gio, I read that blog posting too. I can't see that it says anything about writing exif data, only reading? I'd love to be proved wrong on this :-)

 

 

David
Yes, it only talks about reading indeed.

 

 

Well maybe, he can try manipulate the xml data atop in the jpeg (turn extension to txt and check it out), check out the formatrequirements(http://www.media.mit.edu/pia/Research/deepview/exif.html) ?

 

He is called J.Wiz ;P, so he just might be able to..
Hi,

 

 

I changed strategy. I'll write the xyz coordinates and the image name in a txt file.

 

Based on the documentation (new to PythonCaller), I am trying this code

 

 

----

 

import fme

 

import fmeobjects

 

 

# Template Function interface:

 

def processFeature(feature):

 

 

        pass

 

 

# Template Class Interface:

 

class FeatureProcessor(object):

 

    def __init__(self):

 

        pass

 

    def input(self,feature):

 

        self.pyoutput(feature)

 

    def close(self):

 

     

 

     def writeOrientTxt(feature):

 

name_1=feature.getAttribute('fme_basename')

 

x_1 = feature.getAttribute('_X')

 

y_1 = feature.getAttribute('_y')

 

z_1 = feature.getAttribute('_z')

 

with open('E:\\Data\\GARMIN_GLO_GPS_LOGGER\\Export_Orient.txt', 'w') as f:

 

    write_data = f.write(name_1 +','x_1+','+y_1+','+z_1+'\\r\\n')

 

f.closed

 

        

 

        pass

 

 

-----

 

 

The error I get: 

 

Python Exception <IndentationError>: expected an indented block (<string>, line 18)

 

 

line 18 is ->name_1=feature.getAttribute('fme_basename')

 

 

Anyone can help?

 

 

 

 

Hi,

 

 

Python differ from many other programming languages in that code indentation carries meaning. Indentation must therefore follow the block levels of the code, which isn't the case for your function "writeOrientTxt".

 

 

More info here: http://www.diveintopython.net/getting_to_know_python/indenting_code.html

 

 

David
Ok, Thanks.

 

Can you tell me where I need to change identation?

 


The indentation looks better on your screenshot, but I'm pretty sure your code won't do what you want.
  • Move line 18-23 and insert it before line 14
  • Delete everything from line 17 and down to the bottom
  • Delete line 4-7
  • In your PythonCaller, make sure you call "FeatureProcessor" and not "processFeature"
That might work. If not, repost your code.

 

 

Davdid
Thanks David, it works!
there you go....

Hi @jwisb, thanks for your patience.

Writing EXIF tags now available in FME 2018.0 Betas (Build 18254+)

This means any JPEG read into FME containing EXIF tags can be written back out to JPEG without losing the EXIF tags. To do this, add a new JPEG writer to the canvas ensure that Write to EXIF Tags is set to Yes.


If you are using an older workspace you will need to add a new JPEG writer (not just update the writer), this is to ensure that existing JPEG writer settings aren’t overwritten with the upgrade.

FME supports most of the available EXIF Tags, this website lists all EXIF tags. If there is a EXIF tag that isn't supported in FME please add a comment to the EXIF Writer idea indicating which tag you would like support for.

You can also add EXIF tags to any raster format being written out to JPEG by using an AttributeCreator and creating the EXIF tags you would like to add. Add jpeg_exif_ before any of the EXIF tag types and then manually set the attribute data. Example attributes:


Please note that this is a beta feature and its functionality and appearance are subject to change as the product continues to evolve before the official release.As with all beta features and beta versions of our software, they are not considered production-safe and should be incorporated into your workflows with consideration and testing.


Reply