GPS + Google Maps


11 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: 29
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: 3
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: 852
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: 852
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by topguy » Wed Jan 23, 2013 4:49 pm
Posts: 146
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: 852
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
Posts: 146
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: 852
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: 6
Joined: Tue Feb 05, 2013 4:06 pm
Location: London