Announcement

Collapse
No announcement yet.

New Mac GPS to Google Earth Program

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • New Mac GPS to Google Earth Program

    Hey folks,
    I wrote a program the other day that saves data from a gps reciever to a Google Earth kml file. I know that someone had made an Applescript to do this (elsewhere on this forum), but having choices is never bad, so I hope this is helpful to someone.

    The program uses the gpsd server for getting GPS data, as well as the libxml2 libraries for writing the xml file. An Applescript launcher is included for convenience.

    This works just fine on my computer. As any programmer knows, that means that it probably won't work on anyone else's computer and you'll all laugh at the n00b. That being said, I'd be happy to recieve bug reports or suggestions.

    Download is available here.

    Have fun!
    Ravi

  • #2
    This is awesome! that's so much for running with the ball. what language is it written in?

    Comment


    • #3
      Thanks! The gpsd server and client program are both C++. The applescript user interface is, well, in applescript.

      The client program works by polling gpsd and writing the output in kml format to the specified file. In addition to saving position (with an arrow pointing in the direction of motion), this program saves altitude, speed, and climb rate. In my system (1.33GHz PowerBook G4), this uses under 5% of the processor.

      Ravi

      Comment


      • #4
        i dont have a gps module. can you post a screen shot?

        Comment


        • #5
          Can you make a route with this without an internet connection?

          Comment


          • #6
            When you first run the script, you get the standard choose serial port dialog:



            After choosing the GPS device, you choose the filename to output to:



            The script runs the gpsd and client programs, and displays the following dialog:



            When you're done, you click "done" and it closes the gpsd and client programs. While they're running, they will update the output file once per second. In Google Earth, the file looks like:



            By the way, you can run this without owning a gps module (just to check if it'll work). It will simply output zeros to latitude, longitude, etc...

            As far as making a route with this, what do you mean? All this program does is create a kml formatted file with your current state (lat/lon/...) that can be used as a network link in Google Earth. It doesn't actually talk to GE directly (since GE isn't scriptable yet). If you're talking about saving your previous positions so they display as a route on Google Earth, this doesn't currently support that. However, if there's enough demand I may look into adding that capability.

            Ravi

            Comment


            • #7
              blast!

              beat me to it, i'm writing something similar in obj-c, but my gps unit is backordered.....

              Comment


              • #8
                Originally posted by thatshortkid
                blast!

                beat me to it, i'm writing something similar in obj-c, but my gps unit is backordered.....
                Well heck, go for it! The more people there are working on this, the better the end result will be. I'd be happy to share my code with other developers who want to help.

                Ravi

                Comment


                • #9
                  I was talking about you type in an address and it calculates a route to that address from your current position.

                  Comment


                  • #10
                    Originally posted by super-fly
                    I was talking about you type in an address and it calculates a route to that address from your current position.
                    Oh. Um, that's not what this program is for. You can use GE itself to do that, although you do need an internet connection. No non-commercial program can route without an internet connection, because the required road databases aren't free.

                    Ravi

                    Comment


                    • #11
                      OIC....so i guess the only option for that is still Route 66.

                      Comment


                      • #12
                        Updated the program on Monday, March 13, 7:15am. Changes are:
                        * Most recent version of gpsd.
                        * Speed is now in the name of the Placemark.
                        * Detects if your GPS receiver loses the satellite signals, and displays "GPS Unavailable" as the name.
                        * Data printed in dark green if signal is available, and last known data printed in red if satellite signal lost.

                        Once again, you can download the software here.

                        Have fun!
                        Ravi

                        Comment


                        • #13
                          Mine was the first, granted I wrote in only days, and learned applescript along the way. It's hardly polshed but works:
                          http://www.mp3car.com/vbulletin/showthread.php?t=67053

                          Dude, perhaps we should have worked on this together considering you live 13 miles from me on the other side of Austin.
                          Check out www.austinmodders.com, we have an active forum group of locals.

                          The GPS network program looks much more effecient then the SerialX thing I found, but I also noticed SerialX was in the Zip file, is that still used?

                          Is the source code in there? As I would like the impliment some of the things I have in my code such as movement of the camera based on speed.

                          Comment


                          • #14
                            Well I'll be! I didn't even notice that you lived in Austin too. I actually saw your script the day after I finished my program ... if I had seen it earlier I probably wouldn't have even worked on mine.

                            The only thing I use SerialX for is to display the list of serial ports. I wish I could do this without using SerialX, but I hadn't used Applescript in like 10 years and couldn't figure out how to get it to list the contents of /dev/ .

                            [edit: I figured out how to list serial ports without SerialX, so in future versions SerialX won't be required.]

                            Anyways, I'm gonna do another update to my program in a bit, and will include the code with it then. It'd be cool to see what others want to add to it. One thing I do plan for the future is saving a track file so you can see a location history.

                            If you do want to mess with the code, you'll need to download, compile, and install gpsd (see the first post for a link).

                            Ravi

                            Comment


                            • #15
                              Hey folks,
                              OK, I uploaded a new version. Fully commented source code is included now. If you make changes that you feel will be useful to others please inform me.

                              Ravi

                              Comment

                              Working...
                              X