Skip Menu |

This queue is for tickets about the Geo-Gpx CPAN distribution.

Report information
The Basics
Id: 29202
Status: resolved
Priority: 0/
Queue: Geo-Gpx

People
Owner: Nobody in particular
Requestors: ulf.treger [...] dekoder.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: error with Geo:Gpx
Date: Thu, 06 Sep 2007 12:41:46 +0200
To: bug-geo-gpx [...] rt.cpan.org
From: ulf treger <ulf.treger [...] dekoder.de>
hi, i just started working with your Geo:Gpx module (v0.18) i want to read and manipulate existing GPX files. but i cant start working with it: reading from file doesn't work: my $gpx = Geo::Gpx->new( xml => $params{gpx_file_path} ); ---> not well-formed (invalid token) at line 1, column 0, byte 0 at /usr/local/share/perl/5.8.4/XML/TokeParser.pm line 353 then i try to use a filehandle my $gpx = Geo::Gpx->new( input => $fh ); ---> Can't call method "get_token" on an undefined value at /usr/local/share/perl/5.8.4/XML/Descent.pm line 62, <GEN0> line 235. all dependencies are installed (XML:Descent etc...) i tried the above statements with several GPX files (even that simple one from wikipedia) so the cause should be not the data. i wanted to check http://rt.cpan.org/ first, but the site is down. can u help me oder give a hint to solve this problem? thanx, ulf -- ulf treger // gestaltung und visuelle kommunikation ulf.treger@dekoder.de // http://buero.dekoder.de tel +49 (0)40 391 986 - 56 // fax - 70 mobil +49 (0)173 233 64 46 // skype ulf_t pgp public key (DH/DSS) 0x43402E1D // 2048 bytes büro 3+x // gaußstraße 25b // d-22765 hamburg
On Thu Sep 06 06:50:41 2007, ulf.treger@dekoder.de wrote: Show quoted text
> not well-formed (invalid token) at line 1, column 0, byte 0 at > /usr/local/share/perl/5.8.4/XML/TokeParser.pm line 353
Sounds as if the file you're trying to parse is invalid in some way. Could you mail it to me (andy /at/ hexten /dot/ net) or attach it here please?
Subject: Re: [rt.cpan.org #29202] error with Geo:Gpx
Date: Thu, 06 Sep 2007 15:59:06 +0200
To: bug-Geo-Gpx [...] rt.cpan.org
From: ulf treger <ulf.treger [...] dekoder.de>
Andy Armstrong via RT schrieb: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=29202 > > > On Thu Sep 06 06:50:41 2007, ulf.treger@dekoder.de wrote:
>> not well-formed (invalid token) at line 1, column 0, byte 0 at >> /usr/local/share/perl/5.8.4/XML/TokeParser.pm line 353
> > Sounds as if the file you're trying to parse is invalid in some way. Could you mail it to me (andy > /at/ hexten /dot/ net) or attach it here please? >
hi andy, thanks for reply. i used several gpx-files for testing. test1.gpx --> sample taken from http://en.wikipedia.org/wiki/GPX test.gpx --> file found somewhere osm.gpx --> one of my gpx files best, ulf -- ulf treger // gestaltung und visuelle kommunikation ulf.treger@dekoder.de // http://buero.dekoder.de tel +49 (0)40 391 986 - 56 // fax - 70 mobil +49 (0)173 233 64 46 // skype ulf_t pgp public key (DH/DSS) 0x43402E1D // 2048 bytes büro 3+x // gaußstraße 25b // d-22765 hamburg
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <gpx xmlns="http://www.topografix.com/GPX/1/1" creator="Gartrip 208" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"> <wpt lat="53.551938" lon="9.944347"> <ele>47</ele> <time>2006-10-02T00:00:01Z</time> <name>start 156</name> <sym>-055-</sym> </wpt> <wpt lat="53.551914" lon="9.944018"> <ele>65</ele> <time>2006-10-02T00:00:01Z</time> <name>im toten winkel der webcam 157</name> <sym>-055-</sym> </wpt> <wpt lat="53.552036" lon="9.943695"> <ele>65</ele> <time>2006-10-02T00:00:01Z</time> <name>ferngesteuertes automobil 158</name> <sym>-055-</sym> </wpt> <wpt lat="53.551832" lon="9.941700"> <ele>108</ele> <time>2006-10-02T00:00:01Z</time> <name>eventuell hinweis auf CCTV 159</name> <sym>-055-</sym> </wpt> <wpt lat="53.551934" lon="9.941566"> <ele>78</ele> <time>2006-10-02T00:00:01Z</time> <name>diverse abgeschnittene kabel 160</name> <sym>-055-</sym> </wpt> <wpt lat="53.552204" lon="9.941962"> <ele>73</ele> <time>2006-10-02T00:00:01Z</time> <name>verbotsschild, veraendert, luftballon 061</name> <sym>-055-</sym> </wpt> <wpt lat="53.552142" lon="9.943507"> <ele>58</ele> <time>2006-10-02T00:00:01Z</time> <name>potentieller ort der verweigerung, bewegungsmelder 162</name> <sym>-055-</sym> </wpt> <wpt lat="53.551907" lon="9.944371"> <ele>41</ele> <time>2006-10-02T00:00:01Z</time> <name>hl weg versperrt, gitter 163</name> <sym>-055-</sym> </wpt> <wpt lat="53.552041" lon="9.944405"> <ele>60</ele> <time>2006-10-02T00:00:01Z</time> <name>taube neben kunstraben, mit taubenabwehrstacheln 164</name> <sym>-055-</sym> </wpt> <wpt lat="53.552057" lon="9.944878"> <ele>56</ele> <time>2006-10-02T00:00:01Z</time> <name>strassenbemalung, verweigerungssymbol 166</name> <sym>-055-</sym> </wpt> <wpt lat="53.552177" lon="9.945172"> <ele>55</ele> <time>2006-10-02T00:00:01Z</time> <name>raum gefuellt mit kisten 167</name> <sym>-055-</sym> </wpt> <wpt lat="53.552080" lon="9.945321"> <ele>54</ele> <time>2006-10-02T00:00:01Z</time> <name>?168</name> <sym>-055-</sym> </wpt> <wpt lat="53.551696" lon="9.945866"> <ele>58</ele> <time>2006-10-02T00:00:01Z</time> <name>? 169</name> <sym>-055-</sym> </wpt> <wpt lat="53.551682" lon="9.944959"> <ele>34</ele> <time>2006-10-02T00:00:01Z</time> <name>dieses fahrrad stellt eine unmittelbare gefahr... dar 170</name> <sym>-055-</sym> </wpt> <wpt lat="53.551980" lon="9.942807"> <ele>38</ele> <time>2006-10-02T00:00:01Z</time> <name>immer schoen ein endpunkt 171</name> <sym>-055-</sym> </wpt> </gpx>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <gpx xmlns="http://www.topografix.com/GPX/1/1" creator="MapSource 6.12.4" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"> <metadata> <link href="http://www.garmin.com"> <text>Garmin International</text> </link> <time>2007-08-09T01:06:04Z</time> <bounds maxlat="48.4151688" maxlon="-123.3484836" minlat="48.4029925" minlon="-123.3653082"/> </metadata> <wpt lat="48.4151688" lon="-123.3645823"> <ele>26.8022461</ele> <name>001</name> <cmt>07-AUG-07 17:55:03</cmt> <desc>07-AUG-07 17:55:03</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> <wpt lat="48.4102245" lon="-123.3653082"> <ele>45.5478516</ele> <name>002</name> <cmt>07-AUG-07 18:19:33</cmt> <desc>07-AUG-07 18:19:33</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> <wpt lat="48.4029925" lon="-123.3489400"> <ele>8.2969971</ele> <name>003</name> <cmt>07-AUG-07 18:48:36</cmt> <desc>07-AUG-07 18:48:36</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> <wpt lat="48.4032500" lon="-123.3484836"> <ele>4.6921387</ele> <name>004</name> <cmt>07-AUG-07 18:51:42</cmt> <desc>07-AUG-07 18:51:42</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> <wpt lat="48.4039568" lon="-123.3485296"> <ele>3.4904785</ele> <name>005</name> <cmt>07-AUG-07 18:58:59</cmt> <desc>07-AUG-07 18:58:59</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> <wpt lat="48.4052063" lon="-123.3489774"> <ele>4.4517822</ele> <name>006</name> <cmt>07-AUG-07 19:02:28</cmt> <desc>07-AUG-07 19:02:28</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> <wpt lat="48.4141152" lon="-123.3563148"> <ele>6.1340332</ele> <name>007</name> <cmt>07-AUG-07 19:25:38</cmt> <desc>07-AUG-07 19:25:38</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> <wpt lat="48.4102300" lon="-123.3652986"> <ele>36.4154053</ele> <name>008</name> <cmt>07-AUG-07 20:53:22</cmt> <desc>07-AUG-07 20:53:22</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> <wpt lat="48.4131581" lon="-123.3634481"> <ele>29.2055664</ele> <name>009</name> <cmt>07-AUG-07 21:14:15</cmt> <desc>07-AUG-07 21:14:15</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> <wpt lat="48.4151174" lon="-123.3646421"> <ele>15.7471924</ele> <name>010</name> <cmt>07-AUG-07 21:25:37</cmt> <desc>07-AUG-07 21:25:37</desc> <sym>Flag, Blue</sym> <extensions> <gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"> <gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode> </gpxx:WaypointExtension> </extensions> </wpt> </gpx>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <gpx xmlns="http://www.topografix.com/GPX/1/1" creator="byHand" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"> <wpt lat="39.921055008" lon="3.054223107"> <ele>12.863281</ele> <time>2005-05-16T11:49:06Z</time> <name>Cala Sant Vicen - Mallorca</name> <sym>City</sym> </wpt> </gpx>
On Thu Sep 06 10:00:30 2007, ulf.treger@dekoder.de wrote: Show quoted text
> > Sounds as if the file you're trying to parse is invalid in some way.
> Could you mail it to me (andy
> > /at/ hexten /dot/ net) or attach it here please? > >
> > hi andy, thanks for reply. > > > i used several gpx-files for testing. > > test1.gpx --> sample taken from http://en.wikipedia.org/wiki/GPX
I've just tried this with the Wikipedia example: ============= CUT ================= #!/usr/bin/perl use strict; use warnings; use Geo::Gpx; use Data::Dumper; $| = 1; my $gpx = Geo::Gpx->new( xml => join '', <DATA> ); print Dumper( $gpx ); # GPX example from Wikipedia __DATA__ <?xml version="1.0" encoding="Windows-1252" standalone="no" ?> <gpx xmlns="http://www.topografix.com/GPX/1/1" creator="byHand" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/ GPX/1/1/gpx.xsd"> <wpt lat="39.921055008" lon="3.054223107"> <ele>12.863281</ele> <time>2005-05-16T11:49:06Z</time> <name>Cala Sant Vicenç - Mallorca</name> <sym>City</sym> </wpt> </gpx> ============= CUT ================= It works fine for me. Can you give it a try please?
Subject: Re: [rt.cpan.org #29202] error with Geo:Gpx
Date: Thu, 06 Sep 2007 19:18:45 +0200
To: bug-Geo-Gpx [...] rt.cpan.org
From: ulf treger <ulf.treger [...] dekoder.de>
Andy Armstrong via RT schrieb: Show quoted text
> I've just tried this with the Wikipedia example: > > ============= CUT =================
... Show quoted text
> ============= CUT ================= > > It works fine for me. Can you give it a try please?
hi andy, it works for me also. and your lines gave me the hint to solve the problem. i interpreted the documentation wrong: the two ways... my $gpx = Geo::Gpx->new( xml => $gpx_document ); my $gpx = Geo::Gpx->new( input => $fh ); ...i read (and tested negative) as... my $gpx = Geo::Gpx->new( xml => [path/to/gpx-file] ); my $gpx = Geo::Gpx->new( input => $filehandle ); so, now i have: open(FH, "<test1.gpx") || die; my $gpx = Geo::Gpx->new( xml => join '', <FH> ); close FH; and that works fine! i wonder, it could be a good idea to add this way of accessing the xml data to your documentation? thanks a lot for your hint + sorry for bothering you. best, ulf -- ulf treger // gestaltung und visuelle kommunikation ulf.treger@dekoder.de // http://buero.dekoder.de tel +49 (0)40 391 986 - 56 // fax - 70 mobil +49 (0)173 233 64 46 // skype ulf_t pgp public key (DH/DSS) 0x43402E1D // 2048 bytes büro 3+x // gaußstraße 25b // d-22765 hamburg
On Thu Sep 06 13:26:42 2007, ulf.treger@dekoder.de wrote: Show quoted text
> i wonder, it could be a good idea to add this way of accessing the xml > data to your documentation?
Yes, I think the documentation could be clearer - and the diagnostics more helpful. Show quoted text
> thanks a lot for your hint + sorry for bothering you.
No problem, thanks :)