hills: Generate STL models from SRTM elevation data.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

This program generates 3D models of areas of the earth's surface.

It uses the SRTM 90m elevation data from CGIAR-CSI which is downloadable free of charge (see http://srtm.csi.cgiar.org/). It outputs STL.

Consult README.md for full instructions.

[Skip to Readme]


Versions,,, 0.1.2,,,,,,,,
Change log None available
Dependencies array (>=0.5.1 && <0.6), base (>=4.8 && <4.15), bytestring (>=0.10.6 && <0.12), directory (>=1.2.2 && <1.4), filepath (>=1.4.0 && <1.5), optparse-applicative (>=0.11.0 && <0.17), text (>=1.2.1 && <1.3), transformers (>=0.4.2 && <0.6) [details]
License BSD-3-Clause
Copyright (c) 2014, 2015 David Fletcher
Author David Fletcher
Maintainer david@bubblycloud.com
Category Geography
Home page http://www.bubblycloud.com/hills/
Source repo head: git clone https://github.com/davidfletcher/hills.git
Uploaded by djf at 2020-10-06T13:57:55Z


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Readme for hills-

[back to package description]


A program to generate 3D models of places on the Earth's surface.

It uses as input the SRTM 90m elevation data from CGIAR-CSI, which is downloadable free of charge from http://srtm.csi.cgiar.org. It outputs binary STL.

In spite of its name the program also works on valleys.

-- David Fletcher david@bubblycloud.com

Basic use

Pick a latitude and longitude. (Google Maps will show it when you click on a point.)

Run hills. It won't work because we don't have the input data yet, but it will tell us which tiles we need.

hills --position 56.64,-4.91 out.stl

Obtain the input data tiles from CGIAR-CSI http://srtm.csi.cgiar.org/srtmdata/ or a mirror.

You want 5x5 degree tiles in the ASCII format. The download interface on the website is better than it used to be but it still might be quicker just to construct URLs directly like

wget http://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/ascii/srtm_36_01.zip

Unzip the downloaded file and you should obtain a file named srtm_36_01.asc.

Run hills to generate a model.

hills --position 56.64,-4.91 out.stl

Look at the output in your favourite STL viewer.


--position LAT,LONG

Latitude and longitude as decimals. North of the equator is positive, south is negative. East from Greenwich is positive, west is negative.

Usually the centre of the area to be modelled (but see --offset).

--dimensions ARCSECxARCSEC

Size of the area to model in arcseconds, latitude first. Defaults to 300x600.

Remember as you go further north or south from the equator, arcseconds of longitude get smaller.

--base-altitude METRES

The bottom of the volume to be modelled. Defaults to 0m (sea level). If you are modelling land on a plateau or massif you may want to set this higher so that your model won't be on such a thick base. If you are modelling land that goes below sea level you'll need to use a negative value to put the base low enough.

--scale FACTOR

Defaults to 100, meaning 1:100. This might seem like a larger scale than anyone would want, but note that the program outputs in metres whereas 3D printers commonly expect millimetres, so you might already be getting a factor of 1000 on top of what you specify here.

--input-dir DIR
-i DIR

If you have your .asc files somewhere other than the current directory, point to them with this option.


In arcseconds, latitude first. Offset from the specified position to the southwest corner of the area. By default the position is the centre of the area. So if you'd rather specify the southwest corner you can use an offset of 0x0.

However, the main reason for this option is to generate multi-part models without having to change the reference position. This is convenient because the dimensions are in arcseconds so it's easier to do your local positioning in arcseconds too. It's also more accurate, because the program calculates the number of metres per arcsecond at the specified position, and if you change the position between two of the parts their scales may not match perfectly.

Caveats and bugs


Ben Nevis

This crosses a tile boundary - needs both srtm_35_01.asc and srtm_36_01.asc.

hills -p 56.812,-4.99 ben-nevis.stl

Mont Blanc

Needs srtm_30_03.asc. We use a size of 500x1000 arcseconds and a base altitude of 500m.

hills -p 45.8334,6.8650 -d 500x1000 -b 500 mont-blanc.stl

Part of the Grand Canyon

hills -p 36.13,-111.93 -d 1200x1500 -b 200 grand-canyon.stl

Mount Kilimanjaro

Needs srtm_44_13.asc.

hills -p -3.076,37.35 -d 1500x1500 -b 600 kilimanjaro.stl

Ochil hills

A 1:50000 scale model covering an area about 26km x 13km, in eight parts each about 13cm x 13cm.

hills -p 56.145,-3.96 -s 50 -d 210x375 --offset 0,0 ochils-a0.stl
hills -p 56.145,-3.96 -s 50 -d 210x375 --offset 0,375 ochils-a1.stl
hills -p 56.145,-3.96 -s 50 -d 210x375 --offset 0,750 ochils-a2.stl
hills -p 56.145,-3.96 -s 50 -d 210x375 --offset 0,1125 ochils-a3.stl
hills -p 56.145,-3.96 -s 50 -d 210x375 --offset 210,0 ochils-b0.stl
hills -p 56.145,-3.96 -s 50 -d 210x375 --offset 210,375 ochils-b1.stl
hills -p 56.145,-3.96 -s 50 -d 210x375 --offset 210,750 ochils-b2.stl
hills -p 56.145,-3.96 -s 50 -d 210x375 --offset 210,1125 ochils-b3.stl

The parts are laid out like this:

b0 b1 b2 b3
a0 a1 a2 a3