2

I’d like to decode the location coordinates from the XML file from my Android phone (SGS2). Any solution how to do it, how to convert them to usable coordinates (longitude/latitude)? Looks like it's base64 encoded. from there, no idea.

<string name="lastPosition">wLphlm9S56tDr+Ruft1URA4iubjA111HfIdVuhw3cC8=</string>

Full XML example:

<map>
 <string name="lastPosition">1j+wY60EYdawR3UTnoSsbAcGWRDIlNTCd0j3zXZO1D4=</string>
 <int name="deviceTag" value="1118448321"/>
 <long name="locationReportingIntentTimstamp" value="1363120660401"/>
 <float name="lastAccuracy" value="759.0"/>
 <boolean name="locationHistoryEnabled" value="true"/>
 <long name="lastTimestamp" value="1363121442835"/>
 <long name="lastIntentProcessedTimestamp" value="1363121443003"/>
</map>
9
  • Is there a reason you need to use this XML file as your data source? There are quite a few apps available for Android that will log GPS data to a plain old GPX file, which can be read by tons of software.
    – Dan C
    Mar 15, 2015 at 15:24
  • Can you upload an example of the .XML; was it parsed already?
    – dof1985
    Mar 15, 2015 at 15:43
  • Unfortunately there is no other way, because I have to rebuild a track. And its data was written into several xml files. An example is as follows: Mar 15, 2015 at 19:24
  • <map> <string name="lastPosition">1j+wY60EYdawR3UTnoSsbAcGWRDIlNTCd0j3zXZO1D4=</string> <int name="deviceTag" value="1118448321"/> <long name="locationReportingIntentTimstamp" value="1363120660401"/> <float name="lastAccuracy" value="759.0"/> <boolean name="locationHistoryEnabled" value="true"/> <long name="lastTimestamp" value="1363121442835"/> <long name="lastIntentProcessedTimestamp" value="1363121443003"/> </map> Mar 15, 2015 at 19:25
  • Which application is this from?
    – BradHards
    Mar 16, 2015 at 5:09

1 Answer 1

1

This looks like an encoded polyline to me - for the algorithm to encode/decode, see:

https://developers.google.com/maps/documentation/utilities/polylinealgorithm

Google also has an online tool that can encode/decode:

https://developers.google.com/maps/documentation/utilities/polylineutility

As you noted decoding your polyline seems to result in locations off the coast of Africa:

enter image description here

Judging by the lastTimestamp in the XML file (and assuming this is UTC in milliseconds), these locations were recorded back in 2013 (Tue, 12 Mar 2013 20:50:42 GMT to be exact). So, this data may not be valid tracking data.

I know manufacturers have gotten in trouble in the past over logging device locations to system files as part of the device development process, and then they forget to remove/purge these files before the software is launched to production. My guess is that this file is a leftover debug file from Samsung's internal software testing with the Galaxy S2.

1
  • This phone of my was lost, but was found 2 years later, so the date of the data are accurate. It might was taken to the oceanic locations, but the consecutive locations should be close to each other. And unfortunately this is not the case, when I decode them with the Encoded Polyline tool. But anyway this method is definitely a closer step to the final solution. Mar 20, 2015 at 21:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.