Skip to content

Instantly share code, notes, and snippets.

@hugolpz
Forked from mjhoy/Makefile
Last active August 29, 2015 14:00
Show Gist options
  • Save hugolpz/5970af420be3449108a1 to your computer and use it in GitHub Desktop.
Save hugolpz/5970af420be3449108a1 to your computer and use it in GitHub Desktop.
Wikimaps Atlas : Shaded relief v.05/03

6 Shaded Reliefs

Action: When run, this country.makefile [download][1] the raster GIS DEM sources, process them (unzip, crop, shaded relief, resize, colorize), to output 6 elegant shaded reliefs. Can work for any country or area, given you provide WNES (West/North/East/South) geocoordinates, in decimal degrees.

Output:

  • 2 hillshades:
  • hillshade_grey (GIS tif)
  • hillshade_trans (png)
  • 1 color-relief (wikipedia style):
  • color+hillshade_000pc (GIS tif)
  • 3 mix (for comparison):
  • color+hillshade_050pc (jpg)
  • color+hillshade_100pc (jpg)
  • color+hillshade_multiply (jpg)

For similar data and similar px dimensions, file sizes are .tif:5.0MB, .png:1.6MB, .jpg:239KB. Also, whenever possible and relevant, we use the lighter format.

Direct command:

make -f country.makefile ITEM=India WEST=67.0 NORTH=37.5  EAST=99.0 SOUTH=05.0 WIDTH=1280

Parameters: Derivated from man gdal and man convert.

  • Z= (zFactor, integer >0, default 5): vertical exaggeration used to pre-multiply the elevations
  • AZ= (azimuth, integer [0-359], default: 315): azimuth of the light, in degrees. 0 if it comes from the top of the raster, 90 from the east, ... The default value, 315, should rarely be changed as it is the value generally used to generate shaded maps.
  • ALT= (altitude of light, in degrees, integer [0-90], default 60): altitude of the light, in degrees. 90 if the light comes from above the DEM, 0 if it is raking light.
  • FUZZ= (fuzzy selection, integer [0-100], default 7): colors within this distance are considered equal
  • SHADOW= (integer [0-100]) opacity of the hillshade upon color-relief.
  • WIDTH=... (in px, default: 1280) : width of the bitmaps (tif, png). The EIGHT is conserved from WNES ratio and the WIDTH.

Note: if the input GIS raster is in feet, then s scale should be edited. See man gdal.

[1]: the download task will automatically download the ETOPO1 (342MB) archive file, which may take from few minutes to a dozen of hours, depending on your web line.

Suggestions? Drop me a suggestion/command line @hugo_lz

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment