Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Overlaying


Statistical Data


W


ith a map and some appropriate geographical information, you
can plot statistical information (that is, information that has
some sort of quantity across a range of different points) onto a
Google Map. For example, you could plot the number of accidents at differ-
ent intersections in a city, or highlight the number of sporting events in dif-
ferent cities across an entire country.

Viewing statistical information in a graphical form often makes the infor-
mation significantly easier to understand. For example, in this chapter the
population data of cities in the U.S. is used, and although a tabular form of
the information is helpful, the graphical representations shown in this chap-
ter make it much easier to understand the relationship and relative size of
the different cities across the U.S.

Fortunately, as you’ll see in this chapter, there are many ways in which sta-
tistical information can be overlaid on top of a Google Map. Polylines (the
lines that Google Maps uses to show maps and routes) are one way, and you
can alter their behavior slightly to give some other alternatives. A better
solution, though, may be to use a custom icon.

Generating/Obtaining Statistical Information


There is a wealth of statistical information available if you start looking.
The key element for displaying the information on a Google Map is that it
has some kind of geographical relevance. Secondary to this consideration is
how you want to represent that information.

For example, throughout this chapter the U.S. Census data on population is
used (using the data from http://www.census.gov/). The information
is available on a year-by-year basis. It is also available on a city-by-city (and
state-by-state) basis. With these two combinations of information it is pos-
sible to show the population data both according to its location and to its
year, and, by combining the two, the population growth over time can also
be demonstrated.

First, the raw data.

̨Use polylines to
represent statistical
information

̨Draw bar graphs


̨Draw variable-size
circles

̨Overlay multiple
data

̨Use custom icons


̨Control icon size
according to data

chapter


in this chapter

Free download pdf