views:

33

answers:

2

Hi All,

Is there any way to read garmin's .gpx file in iPhone sdk? I want to display trails on google map.

Thanks Saurabh

A: 

If you take a look at this documentation, it seems that a .gpx file is just a container for a xml file.

Using a NSXMLParser, you could load the file into a NSXMLParser, set the delegate to self (or whichever class you want to recieve the delegate methods), add the NSXMLParserDelegate into your classes interface file and receive the parser:foundAttributeDeclarationWithName:forElement:type:defaultValue: method, and you could filter the file's elements down to latitude and longlitude.

Jack Greenhill
+1  A: 

If you want this in Google, why not try Google tours?

Google tours

Michael Eakins