2. Contents
●
How does GPS work?
●
Receiver types and common protocols
●
Capturing locations via Gpsd
●
Popular mapping systems
●
Map servers and Map data
●
Google Maps API
●
Putting it together in a sample application
●
References
●
Gaming night
3. How does GPS work?
●
DoD operates 27 satellites, 24 active, 3 spares
●
Orbits arranged such that at least 4 “visible” in sky
at any point on earth
●
GPS receiver measures distance to 3 satellites to
compute its location (trilateration)
●
(provide intersecting soap bubbles analogy)
●
Receivers usually track a 4th
satellite to make their
reading more accurate as well as get altitude
●
Measuring distance from satellite is a very
complex task
4. How does GPS work?
●
Assume both receiver and satellite have atomic
clock
●
Both run the same binary pattern starting at
midnight
●
Satellite's pattern lags behind receiver's. This lag is
the travel time of the signal. Distance is calculated
using speed of light
●
Receivers do not really have atomic clocks, it is
sync'ed via the satellites using another complex
process
5. How does GPS work?
●
GPS Errors (weather, urban canyons etc)
●
Differential GPS
●
Galileo (Europe)
●
GLONASS (Russia)
●
DoD reserves right to monkey with GPS signal
provided to non US military receivers – make it
less accurate, or introduce subtle errors (wartime,
other needs)
6. Receiver types and protocols
●
Dedicated personal navigation hardware (Garmin,
Magellan, in-car systems). All have on board maps
and displays that they display their location on
●
Receivers only. USB, Bluetooth, Serial port
devices. Rely on host to provide mapping software
and data
●
“Black boxes.” Consist of GPS receiver and cell or
satellite modem. Report positions to some server
via UDP usually
●
Autonomous and assisted GPS chipsets in cell
phones
7. Receiver types and protocols
●
GPS devices report their location info via some
communications protocol
●
Many devices use a proprietary scheme
●
Most can also talk “NMEA 0183”
●
NMEA 0183 consists of ASCII “sentences”
emitted at 4800 baud
●
You can try it out by attaching a USB or Serial
GPS receiver to your computer and running
hyperterm in 4800 8-N-1
8. Gpsd
●
You can write a program to capture and parse
NMEA 0183 directly from the serial port, have
your program understand proprietary dialects
spoken by other receivers
●
Or, you can use the outstanding open source Gpsd
software to do it for you
●
Gpsd automatically detects and starts reading from
attached receivers of various types. The location
information can be read from port 2947of the
computer running Gpsd, in a format much easier
than NMEA 0183
9. Popular Mapping Systems
●
There are actually 2 parts to a complete mapping
system: A map server and map data
●
Some popular all-in-one systems are Streets and
Trips, Mappoint. These run on the desktop, and
provide street map data
●
Some popular web based mapping systems are
Yahoo Maps, Mapquest and Google Maps
●
All web based mapping systems expose
functionality via various APIs. Simple URL calls,
webservices, javascript etc etc
10. Map Servers and Map Data
●
It is important to differentiate a map server from
the map data that it serves
●
Simply put, a map server, upon being requested,
reads the underlying map data, applies various
POIs on it, and renders the whole lot into a nice
graphic
●
The situation gets much more complex when one
considers the types of map data. Map data can
contain street map info, contour data,
demographics, census info and what not
11. Map Servers and Map Data
●
Map data can be based on different Geodetic datums
●
A datum defines the size and shape of the earth, as well as
the origin and orientation of the coordinate system. The
coordinate system may not even be expressed in latitudes
and longitudes. For example, there is a datum that
expresses location in US-FT east and north of Las Vegas!
●
The most common datum in use today is WGS84 (World
Geodetic System 1984). Other common ones, especially
in the US are NAD27 (North American Datum of 1927)
and NAD83 (very similar to WGS84)
●
If a device reports its position using one datum, and it is
displayed by a map server using a different datum, many
fun errors will result
12. Map Servers and Map Data
●
Map data is available in a dizzying array of
formats: tiff files, ESRI shape files, MapInfo,
SDE, SDC and many, many more
●
A map server worth its salt will be able to
consume data in many of these formats, interpret
them via the prism of the hundreds of datums that
could be in use, and still show your location in the
right place!
●
Map servers also provide other services like
geocoding (converting a street address to
coordinates), reverse geocoding, routing etc
13. Map Servers and Map Data
●
A very popular open source map server is the
ingeniously named “Mapserver”
●
2 extremely powerful open source GIS toolkits are
GDAL & OGR
●
Popular commercial offerings include ESRI
ArcGIS, Telecontar, Mapinfo etc
●
There are many sources of data. Probably the most
well known source of street data is TIGER,
produced by the US Census Bureau
14. Map Servers and Map Data
●
While TIGER is free, and is sufficient for many
projects, it has some issues. For example, it has
various fun errors where a whole town, while
accurately mapped, will be “shifted” 50 feet.
Many details are missing or incorrect, and it is
updated sporadically (the page extension may not
be on it)
●
There are 2 major commercial data providers in
the US. These goliaths are Teleatlas and Navteq.
They usually start with TIGER, do their own
driving and their own secret sauces
15. Map Servers and Map Data
●
Google, MS, Yahoo, Mapquest et al source their
street data from one of these giants
●
They also provide other data, like truck routing,
Hazmat restrictions etc
●
There are also many “boutique” data vendors
catering to specific needs
16. Google Maps API
●
Google has made available a very easy to use
javascript API, with which we can plot locations
on their mapping system
●
Need a Google Map “key”
●
Embed script tag in your html that references a
special javascript file
●
(show simple example)
17. Putting it together
Simple app that monitors your laptop as you drive
around.
●
Little USB GPS receiver attached to laptop
●
Gpsd runs on laptop, receives data from receiver
●
Simple servlet connects to Gpsd on demand, gets
current location
●
Simple HTML file that invokes servlet every n
seconds. Gets location and shows it on Google
Map
●
(show example app)
19. Gaming Night!
●
Multiplayer online gaming @ Agilis
●
Last Thursday of every month, 6:30pm onwards
●
20 slots
●
If interested, email games@agilissystems.com
●
Half-life 2 death match only for now, maybe some
Counter Strike
●
Bring your own computer, monitor, game and
headphones!
●
Snacks will be provided