chapter eleven

11 Geographic Location Visualization and Analysis

 

This section covers:

  • Computing the distance between geographic locations.
  • Plotting locations on a map using the Basemap library.
  • Extracting geo-coordinates from location names.
  • Finding location names in text using regular expressions.

People have relied on location information since before the dawn of recorded history. Cave-dwellers once carved maps of hunting routes into mammoth tusks. Such maps evolved as civilizations flourished. The ancient Babylonians fully mapped borders of thei vast empire. Much later, in 3000 BC, Greek scholars improved cartography using mathematical innovation. The Greeks discovered that the Earth was round, and accurately computed the Earth’s circumference. Greek mathematicians laid the ground-work for measuring distances across the Earth’s curved surface. Such measurements required the creation a geographic coordinate system. A rudimentary system based on latitude and longitude was introduced in 2000 BC.

Combining cartography with latitude and longitude helped revolutionize maritime navigation. Sailors could more freely travel the seas by checking their positions on a map. Roughly speaking, maritime navigation protocols followed these 3 steps:

11.1  The Great-Circle Distance: A Metric for Computing Distances Between 2 Global Points

11.2  Plotting Maps Using Basemap

11.3  Location Tracking Using GeoNamesCache

11.3.1  Accessing Country Information

11.3.2  Accessing City Information

11.3.3  Limitations of the GeoNamesCache Library

11.4  Matching Location Names in Text

11.5  Summary