gpx

Python: TypeError: 'file' object has no attribute '__getitem__'

做~自己de王妃 提交于 2019-12-11 14:28:49
问题 I have a .gpx file which is cut off int the middle of the file. When I try to parse it using the gpxpy library I run into the following error. Parsing points in track.gpx ERROR:root:expected '>', line 3125, column 29 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gpxpy-0.8.7-py2.7.egg/gpxpy/parser.py", line 209, in parse self.xml_parser = LXMLParser(self.xml) File "/usr/local/lib/python2.7/dist-packages/gpxpy-0.8.7-py2.7.egg/gpxpy/parser.py", line 107, in _

ios - Geolocation and Tracking in a gpx file

僤鯓⒐⒋嵵緔 提交于 2019-12-11 14:10:02
问题 I want to implement an application for IOS. This application should track a route in a gpx file. Can you tell me some links or open source project? thank you very much 回答1: so this is a bit of an old question I guess, but I found this in my recent search to do GPX and works really well. The creator has an amazing example on Git as well to see it in action: http://gpxframework.com/ For GPX files, checkout OSRM as well: http://project-osrm.org/ 回答2: check this simple apps to create GPX file

How to reference an exception class in Python?

只愿长相守 提交于 2019-12-11 08:59:26
问题 I want to catch a GPSException thrown by the gpxpy library. try: gpx = gpxpy.parse(open(filepath)) except GPXException: print "GPXException for %s." % filepath Since I am new to Python I do not understand how one would reference the exception via namespace such as gpxpy.gpx.GPSException or an import statement such as .. import gpxpy import gpxpy.gpx import gpxpy.gpx.GPSException 回答1: You need to reference the exception correctly. Either import the exception directly into your module, or use

How to parse GPX file using Haskell's xml-conduit?

心已入冬 提交于 2019-12-10 19:14:54
问题 I'd like to use xml-conduit to parse GPX files. So far I've got the following: {-# LANGUAGE OverloadedStrings #-} import Control.Applicative import Data.Text as T import Text.XML import Text.XML.Cursor data Trkpt = Trkpt { trkptLat :: Text, trkptLon :: Text, trkptEle :: Text, trkptTime :: Text } deriving (Show) trkptsFromFile path = gpxTrkpts . fromDocument <$> Text.XML.readFile def path gpxTrkpts = child >=> element "{http://www.topografix.com/GPX/1/0}trk" >=> child >=> element "{http://www

Creating GPX file from array of CLLocation

泄露秘密 提交于 2019-12-06 23:21:14
问题 My application needs to share array of CLLocations (Route) within devices using application.I have no experience of using GPX before this. Is GPX is best format to do it? How can I create GPX file from given such array of CLLocations? and is there standard GPX parser in Objective C? From what I have searched on net and SO answer to these questions are respectively 1.cant say 2. I have seen some webpages converting data of points in GPX format but could not find how they are doing it. 3. No I

XPath query for GPX files with namespaces?

半腔热情 提交于 2019-12-06 16:09:50
问题 I am able to access the <trkpt></trkpt> nodes by the xpath expression <xsl:for-each select='gpx/trk/trkseg/trkpt'> when the GPX file has the following simple structure: <gpx> <trk> <trkseg> <trkpt lat="50.5324906" lon="7.0842605"> <ele>105.8824463</ele> <time>2010-07-11T08:50:16Z</time> </trkpt> <trkpt lat="50.5323745" lon="7.0843524"> <ele>108.7662354</ele> <time>2010-07-11T08:50:44Z</time> </trkpt> ... </trkseg> </trk> </gpx> How can i achieve the same effect when namespaces are involved, e

Xcode greys out gpx files in filebox

孤街醉人 提交于 2019-12-06 13:40:36
问题 I hope I'm not overlooking anything, but I can't load gpx files into Xcode because they are greyed out in the filebox (see pic). This is in both location menues, in the debugger/location menu (see pic below "Add GPX File to Project" and the scema location menu. However, the presets (London etc) do work. Selecting "Add GPX File to Project" gives me the greyed out gpx files: It's fine and right that all other files are greyed out here, but gpx files should be not greyed out. BTW: it won't help

Delphi free XML parser / Reader for GPX files

末鹿安然 提交于 2019-12-06 08:24:35
I am looking for a free easy to use XML parser / Reader for GPX files in Delphi and was wondering if anyone could recommend one or should i be using Delphi's own XML data binding / XML document? thanks Colin You can use the Tool "XML mapper" of Delphi. Here on my blog, you can find the article "Load an GPX file (XML) y acces to data" that explain how use this tool (XML Mapper). The sample create structure to load GPX Files. You can find other similar post, like this "Generate KML files routes; Tracks on Google Maps" that use this tools also to generate KML files. The webpage is originaly in

How to parse GPX files with SAXReader?

寵の児 提交于 2019-12-05 05:55:51
问题 I'm trying to parse a GPX file. I tried it with JDOM, but it does not work very well. SAXBuilder builder = new SAXBuilder(); Document document = builder.build(filename); Element root = document.getRootElement(); System.out.println("Root:\t" + root.getName()); List<Element> listTrks = root.getChildren("trk"); System.out.println("Count trk:\t" + listTrks.size()); for (Element tmpTrk : listTrks) { List<Element> listTrkpts = tmpTrk.getChildren("trkpt"); System.out.println("Count pts:\t" +

Creating GPX file from array of CLLocation

ぃ、小莉子 提交于 2019-12-05 03:35:51
My application needs to share array of CLLocations (Route) within devices using application.I have no experience of using GPX before this. Is GPX is best format to do it? How can I create GPX file from given such array of CLLocations? and is there standard GPX parser in Objective C? From what I have searched on net and SO answer to these questions are respectively 1.cant say 2. I have seen some webpages converting data of points in GPX format but could not find how they are doing it. 3. No I will be happy if I get alternate answers/views. I understand that these are lot of questions. Any help