Working with GPX-Reporter.py

The name of our program is GPX-Reporter.py. As we saw in the Tag-based and markup-based formats section, in Chapter 2, Geospatial Data, the GPX format is the most common way to store GPS route information. Nearly every program and device relying on GPS data can convert to and from GPX.

For this example, you can download a sample GPX file from at http://git.io/vl7qi.

You will also need to install a few Python libraries from PyPI. If you've worked through the rest of this book, you'll have most of them already:

  • PIL: The Python Imaging Library
  • Numpy: The multidimensional, array-processing library
  • Pygooglechart: A Python wrapper for the excellent Google Chart API
  • Fpdf: A simple, pure python PDF writer

Simply use easy_install or pip to install these tools. We will also be using a module called SRTM.py. This module is a utility to work with near-global elevation data collected during the 11-day Shuttle Radar Topography Mission in 2000 by the Space Shuttle, Endeavor. However, the official version does not yet support Python 3. You can install a Python 3 port provided by GeospatialPython.com of the library using pip through the following command: pip install http://git.io/vl5Ls.

Alternatively, you can also download the zipped file, extract it, and copy the srtm folder to your Python site-packages directory or your working directory: http://git.io/vl5Ls.

You will also need to register for a free WeatherUnderground.com developer account. This free service provides unique tools. It is the only service that provides global and historical weather data for nearly any point location: http://www.wunderground.com/weather/api/?apiref=d7797a6597c63624.

WeatherUnderground will provide you with a text key that you insert into a variable called api_key in the GPX-Reporter program before running it.

Finally, as per WeatherUnderground's terms of service, you'll need to download a logo image to be inserted into the report: http://goo.gl/OoB4gi.

You can review the Weather Underground Terms of Service at http://www.wunderground.com/weather/api/d/terms.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset