Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-23 Thread Thomas Wood
2008/9/23 Daniel Silverstone <[EMAIL PROTECTED]>: > On Mon, 2008-09-22 at 23:46 +0100, Jon Burgess wrote: >> In gpx_parse_coord() >> - It would be worth checking to see if anyone has uploaded any files >> which use ',' as the decimal separator as is used in some locales. I've >> no idea if this is

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-23 Thread Rogier Wolff
On Tue, Sep 23, 2008 at 10:08:15AM +0100, Daniel Silverstone wrote: > On Tue, 2008-09-23 at 11:01 +0200, Rogier Wolff wrote: > > > > Note that the "b" in "wb" should be inside a "#ifdef WINDOWS" or > > > > whatever defines that platform. > My manpage says: > >The mode string can also in

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-23 Thread Daniel Silverstone
On Tue, 2008-09-23 at 11:01 +0200, Rogier Wolff wrote: > > > Note that the "b" in "wb" should be inside a "#ifdef WINDOWS" or > > > whatever defines that platform. > > The 'b' is effectively ignored on Linux, so it should be harmless and > > not need an ifdef. > The manpage on my system does not me

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-23 Thread Rogier Wolff
On Tue, Sep 23, 2008 at 09:25:41AM +0100, Daniel Silverstone wrote: > On Tue, 2008-09-23 at 08:22 +0200, Rogier Wolff wrote: > > On Tue, Sep 23, 2008 at 12:43:54AM +0100, Daniel Silverstone wrote: > > > On Mon, 2008-09-22 at 23:46 +0100, Jon Burgess wrote: > > > > image.c: > > > > gpx_parse_coord()

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-23 Thread Daniel Silverstone
On Mon, 2008-09-22 at 18:00 -0600, Tom Hughes wrote: > >> gpx.c: > >> - The old parser used to accept gz, bzip2, tar, zip etc, is this still > >> supported? > > I couldn't find this in gpx.rb -- is it some magical behaviour of the > > ruby libxml binding?! > The xml_file method in the trace model t

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-23 Thread Daniel Silverstone
On Tue, 2008-09-23 at 08:22 +0200, Rogier Wolff wrote: > On Tue, Sep 23, 2008 at 12:43:54AM +0100, Daniel Silverstone wrote: > > On Mon, 2008-09-22 at 23:46 +0100, Jon Burgess wrote: > > > image.c: > > > gpx_parse_coord() > > > - May want to emit an error if fopen(outfilename, "wb") fails > > > >

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-22 Thread Rogier Wolff
On Tue, Sep 23, 2008 at 12:43:54AM +0100, Daniel Silverstone wrote: > On Mon, 2008-09-22 at 23:46 +0100, Jon Burgess wrote: > > image.c: > > gpx_parse_coord() > > - May want to emit an error if fopen(outfilename, "wb") fails > > Nod, done. Note that the "b" in "wb" should be inside a "#ifdef WIND

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-22 Thread Tom Hughes
Daniel Silverstone wrote: > On Mon, 2008-09-22 at 23:46 +0100, Jon Burgess wrote: > >> gpx.c: >> - The old parser used to accept gz, bzip2, tar, zip etc, is this still >> supported? > > I couldn't find this in gpx.rb -- is it some magical behaviour of the > ruby libxml binding?! The xml_file met

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-22 Thread Daniel Silverstone
On Mon, 2008-09-22 at 23:46 +0100, Jon Burgess wrote: > > I'd really appreciate any comments anyone might have > Hope you don't mind lots of comments :-) The more the better. > main.c: > If the GPX_SLEEP_TIME environment variable is not set then getenv() > returns NULL and causes a segv in atoi()

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-22 Thread Jon Burgess
On Mon, 2008-09-22 at 23:46 +0100, Jon Burgess wrote: > On Mon, 2008-09-22 at 19:51 +0100, Daniel Silverstone wrote: > > > I'd really appreciate any comments anyone might have > > Hope you don't mind lots of comments :-) Overall it looks great and a huge performance win over the old code. Sorry

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-22 Thread Jon Burgess
On Mon, 2008-09-22 at 19:51 +0100, Daniel Silverstone wrote: > I'd really appreciate any comments anyone might have Hope you don't mind lots of comments :-) main.c: If the GPX_SLEEP_TIME environment variable is not set then getenv() returns NULL and causes a segv in atoi(). If you have an erro

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-22 Thread Daniel Silverstone
On Mon, 2008-09-22 at 20:11 +0100, Shaun McDonald wrote: > > My code does not replicate the "delete all traces which are set to > > visible=0" functionality as I am unsure of when this behaviour would > > be > > required. > This is used when people delete their traces. As it is a time > consumi

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-22 Thread Shaun McDonald
On 22 Sep 2008, at 19:51, Daniel Silverstone wrote: > > My code does not replicate the "delete all traces which are set to > visible=0" functionality as I am unsure of when this behaviour would > be > required. This is used when people delete their traces. As it is a time consuming operation,

Re: [OSM-dev] Reimplementation of the GPX importer

2008-09-22 Thread Daniel Silverstone
On Mon, 2008-09-22 at 19:51 +0100, Daniel Silverstone wrote: > My tests, although tainted by the fact that I ran them against an > effectively blank database, show that the C reimplementation takes > approximately 0.4% of that, so approximately 0.12% of a CPU on average > through the month. I real

[OSM-dev] Reimplementation of the GPX importer

2008-09-22 Thread Daniel Silverstone
Hi, After conversations with TomH and others, I have finally gotten around to rewriting the GPX importer in C. Attached is r14 of my code, and I believe it to be *ALMOST* feature-complete. In essence, it functions equivalently to the ruby importer, however it consumes significantly less system r