nidhaloff / gpx-converter

python package for manipulating gpx files and easily converting gpx to other different formats
https://gpx-converter.readthedocs.io/en/latest/
MIT License
67 stars 18 forks source link

elevation not extracted #20

Closed nystromb closed 1 year ago

nystromb commented 1 year ago

Description

I created a virtualmachine for my project and installed gpx-converter to convert gpx file to json. I tested it out on a gpx file I have and saw that the elevation is not being extracted. Here is a sample trackpoint, my usage, and my output.

Sample GPX

<trkseg>
      <trkpt lat="45.757796665" lon="-87.087254604">
        <ele>0</ele>
        <time>1970-01-01T00:00:00Z</time>
      </trkpt>
      <trkpt lat="45.757796665" lon="-87.087254604">
        <ele>0</ele>
        <time>1970-01-01T00:00:00Z</time>
      </trkpt>
      <trkpt lat="45.757796665" lon="-87.087254604">
        <ele>0</ele>
        <time>1970-01-01T00:00:00Z</time>
      </trkpt>
      <trkpt lat="45.757561031" lon="-87.087239819">
        <ele>0</ele>
        <time>1970-01-01T00:00:00Z</time>
      </trkpt>
      <trkpt lat="45.757561031" lon="-87.087239819">
        <ele>0</ele>
        <time>1970-01-01T00:00:00Z</time>
      </trkpt>
      ....
</trkseg>

Usage

(env) ➜ pip install gpx-converter
(env) ➜ gpx_converter -func "gpx_to_json" -in "test/ag.gpx" -out "out.json" 
conversion from gpx_to_json was done successfully
(env) ➜  cat out.json
// summarized output since its long
{
  "time": [],
  "latitude": [],
  "longitude": []
  // no elevation key
} 

I expected to see the elevation key with the data associated, but I did not. I also tried to set the key manually via args programmatically but that did not do it. Am I doing something wrong?

sirdrakeistda commented 1 year ago

I think my pr is not yet in the pip version. If you want to export all gps data to dict, you should have a look on this pr: https://github.com/nidhaloff/gpx-converter/pull/16 @nidhaloff it would be nice, if the pip version could be updated.

nystromb commented 1 year ago

Thanks @sirdrakeistda for that change! I did see your PR and so that's why I was a little confused on why it was not extracted, since it was merged almost a year ago :)

nidhaloff commented 1 year ago

@sirdrakeistda @nystromb sorry for the late reply. Apparently there was an issue with my pypi account. I just resolved it and published the new release

sirdrakeistda commented 1 year ago

My local version (the version including my pr) and the pip version behave differently. I'm not really experienced with github, but I do not see my changes in the file (especially these: https://github.com/nidhaloff/gpx-converter/pull/16/commits/ee3c5f8ad13a4331aa9025f3f34e24666f7a098c https://github.com/nidhaloff/gpx-converter/pull/16/commits/26b394088637080b0b61ebc91283f6175d7dd67d) where I would expect my changes: https://github.com/nidhaloff/gpx-converter/blob/master/gpx_converter/base.py @nidhaloff Is there a reason why this change is not included? It is much more powerfull and flexible then the old implementation and exports much more data.