GPS + Google Maps


15 posts
by realtek » Fri Jan 11, 2013 11:09 pm
Hi,

I was wondering if anyone had any information on how I can hook up a GPS to the Pi, get coordinates and map this on a google map or some kind of service that can be accessed remotely?

Its project I am working on and currently!

Thanks!
Posts: 30
Joined: Wed Jan 09, 2013 3:16 pm
by Carnildo » Sat Jan 12, 2013 7:20 am
The first thing you'll want to do is install GPSD: it's the standard Linux software for interfacing between GPS receivers and programs. After that, it depends on the details of what you're trying to do: I believe both Chrome and Firefox can take data from GPSD and make it available to Javascript, or you might need to write your own program.
Posts: 11
Joined: Wed Jan 09, 2013 7:51 am
by -rst- » Mon Jan 14, 2013 5:23 pm
hook up a GPS to the Pi - possible options (provided that RPi supported hardware found):
- Bluetooth GPS + bluetooth usb dongle
- GPS with USB cable (implementing a serial device)
- GPS with serial cable + serial-2-usb converter
- GPS with serial cable + converter to UART GPIO pins (need to turn off debug output to UART, search for a thread about connecting a MIDI device)
- Arduino etc GPS development module + some extra components to GPIO

get coordinates:
- use the gpsd already suggested
- raw reading of NMEA messages from serial input (some threads about this already)

map this on a google map or some kind of service that can be accessed remotely:
- assuming this means sending the location of the RPi to some remote service, use a http library to connect to the service and store the location using the service API (possibly 'the internet of things')
- if this is about getting the map to the RPi, you could look at doing a http request to Google Maps API ('static API')

Serial reading, parsing the coordinates and calling http services is somewhat easily programmed using Python.
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 899
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by pishi » Thu Jan 17, 2013 8:36 pm
I am also wondering about the same things as 'realtek'...

I must say that I have already searched about this matter both here on this site and on google, but I haven't been able to find any good and simple explanations. I am new to linux and not able to do any programming on my own.

So... I have already a RPi that I have managed to connect to internet by using a 3G USB modem and also through WiFi.
My GPS is also working and I have 3D FIX by using gpsd and cgps.

But from here I'm totally lost...

I want my coordinates (the Pi) to be pushed forward ... either using email... webserver... or even be able to import it directly to a map application that is supposed to run on a different computer. In other words.. I want to see the coordinates remotely.

Could somebody with the knowledge please explain this since I still haven't been able to find them anywhere else. Thanks! :)

Love the Pi btw.
Posts: 1
Joined: Thu Jan 17, 2013 8:24 pm
by -rst- » Wed Jan 23, 2013 4:20 pm
Oh... there are so many different ways to accomplish this and no ready-made solutions...
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 899
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by topguy » Wed Jan 23, 2013 4:49 pm
User avatar
Posts: 666
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway
by -rst- » Wed Jan 23, 2013 5:30 pm

Wonder if Google Earth runs on RPi?
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 899
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by topguy » Thu Jan 24, 2013 9:31 am
-rst- wrote:Wonder if Google Earth runs on RPi?


No. There is no open source version of GE as far as I know.
But there should exist a lot of different mapping applications that might be sucessfully ported to RasPI.

These ones for example.
http://qtmapper.garage.maemo.org/
http://wiki.openstreetmap.org/wiki/MoNav
User avatar
Posts: 666
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway
by -rst- » Thu Jan 24, 2013 12:44 pm
Yep, porting a map app to RPi would be interesting - especially if could use the hw accelerated graphics.

In most cases however, the location of the RPi is required to be monitored somewhere else...

Looks like gpsd provides a sort of web-service: 'presents reports in a well-documented JSON application on port 2749' http://savannah.nongnu.org/projects/gpsd ...so could connect from outside world using just a web-browser (for testing and quick checks) or create an application that connects to read the location...

I would most likely choose to code a small program in Python to run on RPi:
- read the data from gpsd (there are at least a couple of gpsd compatible Python libraries)
- format the data into KML
- push the data to for example COSM (https://cosm.com/) using a HTTP connection to access their API - alternatively could just ftp to personal web-page space or similar
Then could view the location on Google maps specifying the URL to the stored KML...

(Any beginner programmer should start by trying to implement one of the bullet points at a time - begin with any mock-up data...)
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 899
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by PacificDragon64 » Sat Jan 26, 2013 7:49 pm
I managed to install GPSD and a few mapping softwares from the Repository (foxtrotgps, qlandkartegt). I connected my Garmin GPS device to the Pi via USB to Serial cable. It all worked, but terribly slow for my liking. I noticed that adafruit has a GPS breakout module able to interface via GPIO. i wonder if this would be a better solution....much faster i would think. it's only $40. I might give it a whirle.
Cheers!

:-)
User avatar
Posts: 28
Joined: Thu Aug 09, 2012 8:20 pm
Location: Vancouver, Canada
by BillyRayPreachersSon » Tue Feb 26, 2013 4:43 pm
The gpsprune package (http://packages.debian.org/squeeze/gpsprune) runs successfully for me on the RPi, even over ssh+X11 on my Mac:

Code: Select all
sudo apt-get install gpsprune


I've yet to try getting gpsd-logged data into it, but the package details sound very good indeed:

Prune is an application for viewing, editing and converting coordinate data from GPS systems. Basically it's a tool to let you play with your GPS data after you get home from your trip.

It can load data from arbitrary text-based formats (for example, any tab-separated or comma-separated file) or XML, or directly from a GPS receiver. It can display the data (as map view using OpenStreetMap images and as altitude profile), edit this data (for example delete points and ranges, sort waypoints, compress tracks), and save the data (in various text-based formats). It can also export data as a GPX file, or as KML/KMZ for import into Google Earth, or send it to a GPS receiver.

Some example uses of Prune include cleaning up tracks by deleting wayward points - either recorded by error or by unintended detours. It can also be used to compare and combine tracks, convert to and from various formats, compress tracks, export data to Google Earth, or to analyse data to calculate distances, altitudes and so on.

Furthermore, Prune is able to display the tracks in 3d format and lets you spin the model round to look at it from various directions. You can also export the model in POV format so that you can render a nice picture using Povray. You can also create charts of altitudes or speeds. It can also load Jpegs and read their coordinates from the EXIF tags, and export thumbnails of these photos to Kmz format so that they appear as popups in Google Earth. If your photos don't have coordinates yet, Prune can be used to connect them (either manually or automatically using the photo timestamps) to data points, and write these coordinates into the EXIF tags.


Dan

Posts: 7
Joined: Tue Feb 05, 2013 4:06 pm
Location: London
by GMan2XS » Thu Jun 06, 2013 7:14 pm
I know this thread is a bit old, but I've been working on something similar recently. I have one of my Pis powered by a battery pack so it can be mobile. This is connected via Bluetooth to a GPS receiver. It also has one of the new Pi camera boards attached. The whole thing is held in a pack which is fitted on the front of my bike. When I go cycling a python script is running which uses the GPS data to create a KML file which references pictures taken by the camera at regular intervals. When I get home I upload the KML file & the pictures to my network, then load the KML file into Google earth & hey presto, I have a visual record of my ride :D
Posts: 3
Joined: Tue Sep 18, 2012 3:44 pm
by Komak57 » Thu Jun 06, 2013 7:58 pm
Reviving an old thread, rather than creating a new one.

I recently came into the posession of a Microsoft Prolific Pharos GPS-360 USB device we use to use for Microsoft Streets & Tips. As we currently have 2, I figured why not see what the raspberry can do with it. Researching around I found a few low-quality GPS programs like Mumble, and the communication software known as GPSD. The raspberry pi DOES find the device, and showed the driver properly listed, but GPSD can't seem to see the device. I've tried to research as best I can, but I'm running out of leads. Although this isn't a high priority, it would still be an amusing addition to my future replacement radio for my car.

--
Shortly after making this post, I came across some new information.
Grab all 3 software packages:
Code: Select all
sudo apt-get install gpsd gpsd-clients python-gps

start using:
Code: Select all
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock

*ttyUSB0 may differ depending on the amount of TTY devices plugged in. Use
Code: Select all
ls /dev/ttyUSB*
to determine yours.
If no errors were found, you may very well be set up to access your GPS coordinates, supposing your GPS doesn't require alternative configurations, it's within range of the sky, and it's a compatible device.

Setup source: http://learn.adafruit.com/adafruit-ultimate-gps-on-the-raspberry-pi/setting-everything-up
Compatibility: http://gpsd.berlios.de/hardware.html

Still trying to research my original question as to what software I should be using with GPSD to track my route. Preferably something with an offline mode to avoid 3G fees and such.
Posts: 4
Joined: Sat Apr 13, 2013 3:36 am
by riskpw » Mon Jun 10, 2013 10:57 pm
User avatar
Posts: 23
Joined: Sun Jan 20, 2013 1:02 pm
Location: korea
by team44 » Fri Jun 28, 2013 12:07 am
GMan2XS wrote:I know this thread is a bit old, but I've been working on something similar recently. I have one of my Pis powered by a battery pack so it can be mobile. This is connected via Bluetooth to a GPS receiver. It also has one of the new Pi camera boards attached. The whole thing is held in a pack which is fitted on the front of my bike. When I go cycling a python script is running which uses the GPS data to create a KML file which references pictures taken by the camera at regular intervals. When I get home I upload the KML file & the pictures to my network, then load the KML file into Google earth & hey presto, I have a visual record of my ride :D


GMan2XS. I've been planing on doing something very similar. Is there any chance you will be sharing your code and I could use it as a strarting point?
thanks
Posts: 1
Joined: Thu Jun 27, 2013 11:59 pm