Open stelldogg opened 3 years ago
Hello,
I don't know from where come the parser.parseString
function but you shouldn't need it.
fs.readFile
already return a string that should be directly parsed.
let gpx = new gpxParser();
fs.readFile(<YourFilePath>, { encoding: "utf-8" }, function (error, data) {
gpx.parse(data);
console.log("Found " + gpx.tracks.length + " tracks");
});
Hi Luuka - I did eventually get it to work. Thanks for the response. I was asking more in terms of some info regarding the success of the call to gxp.parse(<data>)
.
hey, @Luuka thanks for your lib! I have the same question: is there a way to determine whether parsing has finished successfully? I noticed that the library just stops parsing when an unexpected tag happens and I didn't find a way of ensuring that the whole file was parsed.
I'm constantly fighting this thing to take the right format file. I have a local file that I have parsed sucessfully before, but when trying to port all of my code to server and run:
The code above never shows any tracks.
Any tips on locating errors when parsing this thing?