title: NodeJS - Converting GPX to Geojson return empty array
body: <p>I have a form where the user upload a GPX file and is then converted into Geojson, I use <a href="https://github.com/mapbox/togeojson" rel="nofollow noreferrer">mapbox/togeojson</a> module to achieve it and I have this code : </p>
  
  <pre><code>const togeojson = require ('togeojson')
  const jsdom = require('jsdom');
  const { JSDOM } = jsdom;
  const fs = require ('fs');
  const DOMParser = require('xmldom').DOMParser;
  const multer = require('multer');
  const upload = multer({ dest: 'uploads/' })
  module.exports = (express, Courses) =&gt; {
  
  var courses_router = express.Router()
  
  courses_router.route('/')
      .post(upload.single('gpxFile'),(req, res, next) =&gt; {
          let file = req.file
          if (file) {
              console.log("Uploaded : " + file.originalname + " to " + file.path)
              fs.readFile(file.path, (err, data) =&gt; {
                  // let gpxJSDOM = new JSDOM(data)
                  let gpx = new DOMParser().parseFromString(file.path, 'text/xml');
                  let converted = togeojson.gpx(gpx)
  
              })
          }
  
          // var path = utils.ModifyString(req.body.title)
          // return false;
          // course_container.CreateCourses(Courses, req, res, path)
      })
  </code></pre>
  
  <p>When I log the result of <code>converted</code>, I get : <code>{ type: 'FeatureCollection', features: [] }</code>, which looks like Geojson structure but is not filled with the corresponding datas (I have checked on an <a href="https://mapbox.github.io/togeojson/" rel="nofollow noreferrer">online convertor</a> that my GPX datas are good)
  I also tried using JSDOM as this <a href="https://www.devout.io/working-with-gpx-data-using-nodejs-mongodb/" rel="nofollow noreferrer">tutorial</a> suggests but with no results, I guess there is some data manipulation that is wrong on my code but I have no clue where.</p>