Skip to main content

I have some exif GPS data that I want to plot points for. These are strings:

 

 

 

jpeg_exif_gpslatitude    (54) (59.0226) (0)

 

jpeg_exif_gpslongitude    (1) (44.0662) (0)

 

 

My problem is - how do I get these into a format 2d point adder will use? I can easily strip the brackets, but then its still a string and I get this:

 

 

2013-02-18 17:01:35| 0.6| 0.0|ERROR |2DPointAdder: @Tcl2 -- failed to evaluate expression `FME_Coordinates addCoord {1 44.0662 0} {54 59.0226 0}' -- String value `1 44.0662 0' contains invalid characters and could not be converted into a float

 

 

Thanks.

 

 

Note: Sorry about the colour etc. That's what happens when you copy/past it seems and there's no "reset" button.
Hi Jonathan,

 

 

I had to do this recently. You need an attributesplitter to split the degrees, minutes & seconds into sepreate fields, then use an expression evaluator to conver to decimal degrees.

 

 

More info here http://fmepedia.safe.com/articles/Samples_and_Demos/DMS-to-Decimal-Degrees-Workspace

 

 

Owen
Hey Owen, much appreciated, that worked a treat. Well, except the few seconds where I wondered why I was in the North Sea. Must remember west is negative. ;-)

 

Cheers,

 

Jonathan
The DecimalDegreesCalculator can be pretty handy in these cases too. I think it was the solution to 'packaging' the formula for the conversion.
Thanks Dave. That transformer didn't come up when I did my searching. I was searching for "longitude" and "latitude".

 

 

Safe: Could you add "longitude", "latitude" and "WGS84" to the keywords for that transformer.
"Safe: Could you add "longitude", "latitude" and "WGS84" to the keywords for that transformer"

 

 

I will file a request with the development team to do just that. Thanks for the suggestion.

 

 

Mark
Added the keywords (and a couple of others) in build 13429 - so I expect this will be in 2013 Service Pack 1 when it is released.
Thanks Mark. I appreciate its hard to know what people will search for. 🙂
This is a common quest, I guess. 

 

Does anyone have the proper Format String for the AttributeSplitter, and is willing to share it?

 

 

(SAFE: or putting it in an ExifPos2point transformer?!)

Reply