phyghtmap

Contents

What is phyghtmap?

phyghtmap is a little program which lets you easily generate OSM contour lines from NASA SRTM data. It was initially created as replacement for srtm2osm which stopped working when the NASA switched their download server and started distributing the raw SRTM data via http instead of ftp. In the meanwhile, srtm2osm is working again due to the efforts of bomm.

However, phyghtmap has some advantages compared to srtm2osm. One is that you won't need a C# runtime environment installed on your machine. This corresponds to another advantage: You will need to have python installed on your machine. Another important thing is that phyghtmap generates already tiled data. Furthermore, phyghtmap seems to slightly outperform srtm2osm. If you are using a multi-core machine and are running a POSIX compliant operating system you will save much time by a simple parallelization.

Starting from phyghtmap version 1.2, there is the possibility to use data from www.viewfinderpanoramas.org. This covers void areas of the NASA SRTM data, e. g. in the high alps or high asia etc. as well as data north of 60 degrees of latitude of north. For an overview which areas are covered by these data, have a look at viewfinderpanorama's 3 arc seconds coverage map and the corresponding 1 arc second coverage map. For information how to use this, see the Usage section.

Starting from phyghtmap 1.30, single file output and gzip-compressed output are possible.

Phyghtmap 1.40 introduces pbf output support as well as polygon support.

Phyghtmap 1.60 introduces o5m output support.

Phyghtmap 1.70 introduces the possibility to use GeoTiff files as input data.

Phyghtmap 1.80 adds login handling for NASA's earthdata site. This is needed if you want to use SRTM version 3.0 data. Username and password can be specified using the --earthdata-user and --earthdata-password options, respectively. To use this, you have to create an earthdata login at NASA's earthdata site first. For more explanation on this, see the respective options at the online manpage. The earthdata login is deprecated and not needed any longer since version 2.10.

Phyghtmap 2.0 is the first released version working with python3.

Phyghtmap 2.10 changes login handling for NASA's earthdata site to that for USGS' earthexplorer site (EROS data center). This is needed if you want to use SRTM version 3.0 data. Username and password can be specified using the --earthexplorer-user and --earthexplorer-password options, respectively. To use this, you have to create an earthexplorer login at USGS' earthexplorer site first. For more explanation on this, see the respective options at the online manpage.

Phyghtmap 2.20 adds Ramer-Douglas-Peucker (RDP) contour line simplification which can be exploited to reduce the output file size.

Note that the intended use is not to upload generated contour OSM data to the OSM servers but to use it for fancy maps.

Download

At the moment, you have the choice between two different distribution types:

Previous versions can be found at the download page.

Dependencies

I tested the installation process under Windows. If you want to install phyghtmap on a Windows machine, go down to the Windows installation section.

The installation process requires python3 and a working python3 setuptools installation.

The program itself should run with python >= 3.0 (Windows users, take a look here). Some additional dependencies have to be installed on your system in order to run phyghtmap:

Notes for Windows users

I did some testing on Windows. Look here. If there are problems, please tell me at my OSM user page.

If you are looking for python binaries for Windows systems, maybe also have a look here.

Notes for Mac OS X users

There is a problem with the matplotlib installation on Mac OS X systems. The workaround is to use the Enthought Python Distribution which already comes with the setuptools, matplotlib and numpy libraries.

Please note that I did not do any testing on Mac OS X. I just suppose it should work. If not, please tell me at my OSM user page.

Installation

Source Distribution

If you are not running a Debian-like system, you will want to have the source distribution. This is especially true, if you want to use phyghtmap on a Windows machine. If so, go down to the seperate Windows installation section.

To install phyghtmap, unpack the source file, chdir to the unpacked source directory and then say

sudo python3 setup.py install
which will install the stuff on your system.

If you are not a Windows user and have no sudo installed, I guess you know what to do.

If you don't have the permissions to globally install phyghtmap but want to use it anyway, you may want to set up a virtual python environment and install phyghtmap there. If so, take a look here.

Debian package

On Debian-like operating systems, you will want to use the .deb package.

To install it, as usual just say

sudo dpkg -i phyghtmap_2.23-1_all.deb

and you are done.

Windows Installation

I successfully went through the installation process on a Windows machine. The machine was running the 32-bit version of Windows XP. I used python 2.7, but I suppose any newer version < 3 should work in the future. Below, the installation process using python 2.7 is described. If you want to use a newer python version, be sure to select the corresponding library versions. The windows installation worked with phyghtmap 1.42. phyghtmap 1.30 will not properly work.

Since phyghtmap 1.70 one can use GeoTiff files as input data. This feature requires python GDAL bindings. It happens that I don't have a Windows machine to test the installation process right now. Fortunately, you may be haoppy without the GDAL bindings if you don't want to use GeoTiff input data.

Here is how I got it working:

Now you should have a working phyghtmap installation. The phyghtmap executable is located under c:\python27\Scripts\phyghtmap.exe.

Usage

For information how to use phyghtmap, see the online manpage or say either

man phyghtmap

or

phyghtmap --help

I guess that should be enough to successfully run phyghtmap. If not, send me a note at my OSM user page.