fw2kml - A Tool to Convert Featherweight GPS Data to .kml files for Google Earth!

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
---> 30 latindex = fields.index("LAT")
Hello, I wanted to test the tool and I get an error message. Why can that be? Thanks
 

Attachments

  • dtl2.csv
    104.3 KB · Views: 0
I tried the Google Collaboratory Notebook you provided. Seriously... blown away! It was easy to use, worked flawlessly and is such an awesome visualizer for my flight. THANK YOU!:bravo:
 
The collaborator is working great, but the stand alone application .exe file doesn't do anything when I click on it.
 
Glad to hear it worked and my instructions were clear, cheers!
Ahh… ok. Thanks. I was trying to install it so I could drag the file into it. I didn’t know you could drag/drop a file on to an exe file directly. I’ll give it a try.
 
When I drag the messy whole days file into it it works. But when I seperate flights, it does not?
edit - nevermind - looks like the program even separates the flights in the KLM for me. Can this program get cooler?!? - I think not! Thanks so much!
 

Attachments

  • 2023-07-23-Log SL.csv
    12.2 KB · Views: 0
  • 2023-07-23-Log WM.csv
    29.8 KB · Views: 0
Last edited:
I haven't flown in a while, and I've had no problem with this conversion tool in the past. However, I just tried to convert a file from a friend of mine that flew last weekend and am having no luck. Comparing his recent file to one of my older files, it appears the number of columns and headers have changed. The newer file contains additional information as well. I believe this file may have been transfered from the newer Android Blue Raven app rather than the iFIP app.

The newer file is attached.
 

Attachments

  • Log_03-20-2024_07_18.csv
    1.1 MB · Views: 0
I haven't flown in a while, and I've had no problem with this conversion tool in the past. However, I just tried to convert a file from a friend of mine that flew last weekend and am having no luck. Comparing his recent file to one of my older files, it appears the number of columns and headers have changed. The newer file contains additional information as well. I believe this file may have been transfered from the newer Android Blue Raven app rather than the iFIP app.

The newer file is attached.
Thanks for letting me know, I'll have to dig into it later today.
 
It isn't meant to, it functions by dragging the input file on top of it. UI is hard :)
One step that would make it easier is to encapsulate your code in a class rather than using global variables. As it is right now, everything leans on that "droppedFile" global getting set, and the only options are to pull from the command line argument or change the statically coded value which makes your code pretty hard to import.

If you can organize your code such fw2kml is a class that can be imported into other scripts, that would help for making a GUI. You'd have something like:
Python:
class fw2kml():
    def __init__():
        pass # do anything to set up the conversion tool
    
    def convertFile(droppedFile):
        totalflights = 1
        badtimedelta = False
        # pretty much copy paste your entire try/except block in here
        
tool = fw2kml()
if len(sys.argv) > 1:
    for path in sys.argv[1:]:
        tool.convertFile(path)
# allows you to do ./fw2kml.py file1.csv file2.csv ...
I can't do much right now because I'm at work, but I can take a look later and make some changes with a pull release for you if you're okay with that.
 
One step that would make it easier is to encapsulate your code in a class rather than using global variables. As it is right now, everything leans on that "droppedFile" global getting set, and the only options are to pull from the command line argument or change the statically coded value which makes your code pretty hard to import.

If you can organize your code such fw2kml is a class that can be imported into other scripts, that would help for making a GUI. You'd have something like:
Python:
class fw2kml():
    def __init__():
        pass # do anything to set up the conversion tool
   
    def convertFile(droppedFile):
        totalflights = 1
        badtimedelta = False
        # pretty much copy paste your entire try/except block in here
       
tool = fw2kml()
if len(sys.argv) > 1:
    for path in sys.argv[1:]:
        tool.convertFile(path)
# allows you to do ./fw2kml.py file1.csv file2.csv ...
I can't do much right now because I'm at work, but I can take a look later and make some changes with a pull release for you if you're okay with that.
Definitely! I reopened the code for the first time yesterday since the original sprint and MAN. Why didn't I use pandas? Why did I format it that way?

I'll probably take a stab at cleaning it up fully..
 
Definitely! I reopened the code for the first time yesterday since the original sprint and MAN. Why didn't I use pandas? Why did I format it that way?

I'll probably take a stab at cleaning it up fully..
Bane of being a programmer exploring a new project lol. I have a telemetry GUI that's about 2000 lines and it has been an ongoing effort to refactor it into something more workable in the long term. Projects like this tend to get messy quick because you have a lot of ideas early on lol.

I'll try and help you out and maybe I can throw in a GUI because I think I have an idea of how to do that easily.
 
Definitely! I reopened the code for the first time yesterday since the original sprint and MAN. Why didn't I use pandas? Why did I format it that way?

I'll probably take a stab at cleaning it up fully..
All I can say is that I greatly appreciate you creating and maintaining this. I know this is a lot, but it's a great tool!
 
Bane of being a programmer exploring a new project lol. I have a telemetry GUI that's about 2000 lines and it has been an ongoing effort to refactor it into something more workable in the long term. Projects like this tend to get messy quick because you have a lot of ideas early on lol.

I'll try and help you out and maybe I can throw in a GUI because I think I have an idea of how to do that easily.
That would be great, first thing I got pushback on is compatibility with Apple so if you have a way to maintain that with a GUI approach I would.
 
That would be great, first thing I got pushback on is compatibility with Apple so if you have a way to maintain that with a GUI approach I would.
lol, I'm a mac user luckily. I've been using PyQT5... I think there are better options, but this is a simple GUI so I don't think we need to worry. It is cross-platform compatible. It'd probably be a simple as this (missing a handful of lines but you get the gist... I'd throw your logo in the middle of the window, and maybe have a progress bar pop up during the conversion):

1711031715085.png

(mind you... this is just a quick, unreviewed bit of code, this need some more imports and corrections)
 
Last edited:
View attachment Screen Recording 2024-03-21 at 11.59.23 AM.mov
Quick demo of drag and drop gui; with multiple files too. (my branch https://github.com/kayla-tokash/fw2kml/tree/DragDropGui)

Another suggestion would be to only accept files with the correct extension. I accidentally dropped kml in there and the whole thing crashed trying to parse it. It could have failed more gracefully.

E: You're gonna hate me because I'm gonna give you enough suggestions to rewrite the whole thing lol. Another thing I noticed is converting the same file twice will overwrite the outputted converted file. Instead, it'd be nice if you counted the existing instances of the file name and had a numbering system so they don't get overwritten.

e2: One thing that will help with batches is multithreading support. I can whip something up for that with this gui
 
Last edited:
I haven't flown in a while, and I've had no problem with this conversion tool in the past. However, I just tried to convert a file from a friend of mine that flew last weekend and am having no luck. Comparing his recent file to one of my older files, it appears the number of columns and headers have changed. The newer file contains additional information as well. I believe this file may have been transfered from the newer Android Blue Raven app rather than the iFIP app.

The newer file is attached.

Yeah looks like instead of GS export and a tracker export, the BlueRaven app gives both GS and Tracker information together.
 
View attachment 636498
Quick demo of drag and drop gui; with multiple files too.

Another suggestion would be to only accept files with the correct extension. I accidentally dropped kml in there and the whole thing crashed trying to parse it. It could have failed more gracefully.

E: You're gonna hate me because I'm gonna give you enough suggestions to rewrite the whole thing lol. Another thing I noticed is converting the same file twice will overwrite the outputted converted file. Instead, it'd be nice if you counted the existing instances of the file name and had a numbering system so they don't get overwritten.

e2: One thing that will help with batches is multithreading support. I can whip something up for that with this gui
Good thing I planned on rewriting it anyway haha. GUI looks good, I'll try to get a more robust logic implemented by the end of the week if I can.
 
Some other things I did in my branch:
- refactored it all into "fw2kmllib.py" and made "fw2kml.py" and "fw2kmldrag.py" import the contents of that/and use it; it's currently not tested. Goal is to reduce the code reuse by putting your code in one importable place
- refactored your conversion stuff to remove the unneeded try-except blocks and improved some of the syntax (tested, seems to work, need to check if the kml outputted is valid EDIT, checked and it worked)
 
Last edited:
Back
Top