11 Geographic location visualization and analysis

 

This section covers

  • Computing the distance between geographic locations
  • Plotting locations on a map using the Cartopy 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 the borders of their vast empire. Much later, in 3000 BC, Greek scholars improved cartography using mathematical innovations. The Greeks discovered that the Earth was round and accurately computed the planet’s circumference. Greek mathematicians laid the groundwork for measuring distances across the Earth’s curved surface. Such measurements required the creation of 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 three steps:

11.1 The great-circle distance: A metric for computing the distance between two global points

11.2 Plotting maps using Cartopy

11.2.1 Manually installing GEOS and Cartopy

11.2.2 Utilizing the Conda package manager

11.2.3 Visualizing maps

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

Summary