Coder Social home page Coder Social logo

nidhaloff / gpx-converter Goto Github PK

View Code? Open in Web Editor NEW
66.0 8.0 18.0 295 KB

python package for manipulating gpx files and easily converting gpx to other different formats

Home Page: https://gpx-converter.readthedocs.io/en/latest/

License: MIT License

Makefile 6.57% Python 93.43%
gpx gpx-files gpx-parser gpx-format gpx-converter converter file-converter csv-parser csv-files csv-converter gpx-to-dataframe gpx-to-csv gpx-to-excel csv-to-gpx gpx-to-json

gpx-converter's Issues

Uppercase File Extension Not Supported

  • gpx_converter version: 1.7.3
  • Python version: 3.8.10
  • Operating System: Windows 10

Description

It seems that the check for input_extension fails if your GPX file has an uppercase file extension.

What I Did

from gpx_converter import Converter

gpx_file = r"C:\Data\Test_GPS_Data.GPX"
Converter(input_file=gpx_file).gpx_to_dataframe()

Throws the following:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-d42e2417745d> in <module>
----> 1 Converter(input_file=gpx_file).gpx_to_dataframe()

~\AppData\Local\programs\Anaconda3\envs\gpx\lib\site-packages\gpx_converter\base.py in gpx_to_dataframe(self, lats_colname, longs_colname, times_colname, alts_colname)
     59         """
     60         if self.input_extension != ".gpx":
---> 61             raise TypeError(f"input file must be a GPX file")
     62 
     63         if not lats_colname or not longs_colname:

TypeError: input file must be a GPX file

But running the following works:

from gpx_converter import Converter

gpx_file = r"C:\Data\Test_GPS_Data.GPX"
Converter(input_file=gpx_file.lower()).gpx_to_dataframe()

Should be as easy as changing that extension check to:

 if self.input_extension.lower() != ".gpx":

csv_to_gpx does not use elevation and time

  • gpx_converter version:
  • Python version:3.8
  • Operating System:Ubuntu20.04

Description

When converting csv_to_gpx only latitude and longitude are taking in consideration. What about elevation, time, extensions?

I see that when converting from gpx to csv those are taking in consideration

csv to gpx

  • gpx_converter version: 2.1.0
  • Python version: 3.11
  • Operating System: Windows 10

Description

I want to convert my data from csv to gpx as points.

I would need the gpx to be generated as individual points and not as a path.
Do you have something like this in the pipeline?

Feature Request: Extract more data

Description

It would be nice to get more data from GPX files. For example number of satellites and all data from the extension part.

This is an example for a gpx section with data which could be imported:

<trkseg>
  <trkpt lat="34.837636" lon="15.02789063">
   <time>2021-12-11T00:05:49Z</time>
   <ele>23.72</ele>
   <sat>11</sat>  
   <extensions>
     <speed>0.000</speed>
     <accuracy>25.73</accuracy>
     <batterylevel>35.00</batterylevel>
     <useragent>API/0.1.0</useragent>
   </extensions>
  </trkpt>

Thank you for your great work. I like this tool very much.

Add time and altitude column

When you convert the gpx file to another format it does not include the time and altitude column of the gpx file. These are essential if you want to analyze your gpx file

add more tests

Description

This issue is great for new comers who want to join the project. You can write more tests to test the functionality. Feel free to work on this or discuss it with me

elevation not extracted

  • gpx_converter version: 2.0.0
  • Python version: 3.9.13
  • Operating System: Mac OS Monterey 12.5

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?

Maintainers/Collaborators needed

Description

Hi everyone,

Since I don't have much time to work further on the package, I would like to invite collaborators to maintain it. If anyone is interested, please contact me here and I would give you access to the repo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.