locked
GPS.Longitude is written as 1 1 0.00010

    Question

  • Hi,

    Simple Imaging Sample shows how to write GPS coordinates to an image file. For whatever reason it always writes 1 1 0.00010 for Longitude. I've been looking at the code and trying to figure out why it is not writing specified Longitude data. It works fine for the Latitude parameters.

    Anyone seen the same problem and have solution how to fix it?

    this is an excerpt of the code that make this change:

    ---------------------------------------------------------------------------

                properties["System.GPS.LatitudeRef"] = latitudeRef; 
                properties["System.GPS.LongitudeRef"] = longitudeRef; 
     
                    var latNum = new Uint32Array([ 
                    latitude[0], 
                    latitude[1], 
                    parseInt(latitude[2] * 10000
                    ]); 
     
                var longNum = new Uint32Array([ 
                    longitude[0], 
                    longitude[1], 
                    parseInt(longitude[2] * 10000
                    ]); 
     
                var latDen = new Uint32Array([1110000]); 
                var longDen = new Uint32Array([1110000]); 
     
                properties["System.GPS.LatitudeNumerator"] = latNum; 
                properties["System.GPS.LongitudeNumerator"] = longNum; 
                properties["System.GPS.LatitudeDenominator"] = latDen; 
                properties["System.GPS.LongitudeDenominator"] = longDen; 

    ------------------------------------------------------------------------------------------

    I even tried to change

    var longNum = new Uint32Array([ 
                    longitude[0], 
                    longitude[1], 
                    parseInt(longitude[2] * 10000
                    ]); 

    to use hardcoded sample data, and it still writes 1 1 0.00010.

    var longNum = new Uint32Array([ 
                    30, 
                    20, 
                    111111
                    ]); 

    Tuesday, November 27, 2012 10:35 PM

All replies

  • Doing some testing and if I set "Rating" to any star then Longitude is written to image. If "rating" is not selected then Longitude is not changed at all. In my initial test it was set to 1 1 0.00010, that is why it was not changed.

    Any reason why Longitude will not be written if "rating" is not changed? The Latitude gets set regardless of "rating".

    Wednesday, November 28, 2012 3:23 AM