Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Commanding Cartography: Take Control of Faster,...

Joshua Stevens
October 17, 2018

Commanding Cartography: Take Control of Faster, More Elegant Workflows from the Command Line

Compelling cartography has never been easier or more abundant. We are inundated with new tools and technologies. All the while, one of the most powerful assets in the cartographer's arsenal is being overlooked: the command line. Using keystrokes to create maps might sound like a task of yesteryear, but I am here to tell you it is a wormhole to the future. Whether you design maps for national parks or newsrooms, the terminal will enable you to supercharge your workflows with speed and elegance. This talk will introduce some old tricks and new tools for designers on any deadline.

Joshua Stevens

October 17, 2018
Tweet

More Decks by Joshua Stevens

Other Decks in Science

Transcript

  1. C O M M A N D I N G

    Joshua Stevens C A R T O G R A P H Y
  2. WHERE WE’RE GOING The case for the command line Some

    examples from the Earth Observatory 3 must-know tools + how to apply them (and we’ll only scratch the surface!)
  3. *

  4. Daily, data-driven visuals (maps + satellite imagery) 14,600 images since

    1999 EARTH OBSERVATORY earthobservatory.nasa.gov
  5. EARTH OBSERVATORY Daily, data-driven visuals (maps + satellite imagery) 14,600

    images since 1999 457 individual stories in 2017 earthobservatory.nasa.gov
  6. EARTH OBSERVATORY 0 50 100 150 200 250 2010 2011

    2012 2013 2014 2015 2016 2017 2 images 3+ images 15 30 45 60 75 2013 2014 2015 2016 2017 Reporting is Increasingly Visual Visuals are Increasingly Map-only
  7. Global data @ 500 m/px Consistent data scaling Multiple layers

    (land, water, night lights, +clouds) Processed with GDAL
  8. High-dimensional data (lat, lon, temp, depth, time) Map component +

    temp at depth Two years of daily measurements (730 frames)
  9. Made with matplotlib + ImageMagick High-dimensional data (lat, lon, temp,

    depth, time) Map component + temp at depth Two years of daily measurements (730 frames)
  10. Made with matplotlib + ImageMagick High-dimensional data (lat, lon, temp,

    depth, time) Map component + temp at depth Two years of daily measurements (730 frames)
  11. Made with matplotlib + ImageMagick High-dimensional data (lat, lon, temp,

    depth, time) Map component + temp at depth Two years of daily measurements (730 frames)
  12. Made with matplotlib + ImageMagick High-dimensional data (lat, lon, temp,

    depth, time) Map component + temp at depth Two years of daily measurements (730 frames)
  13. TOOLS YOU NEED TO KNOW gdal_translate Convert formats Scale data

    (32, 16, 8 bit) Georeference Resize Resample Crop gdalwarp Reproject Resample gdaldem Hillshade Slope Aspect …
  14. TOOLS YOU NEED TO KNOW gdal_translate Convert formats Scale data

    (32, 16, 8 bit) Georeference Resize Resample Crop gdalwarp Reproject Resample gdaldem Hillshade Slope Aspect … Apply color palettes**
  15. EXAMPLE: SEA SURFACE TEMP https://coralreefwatch.noaa.gov/satellite/bleaching5km/index.php $ gdalwarp -t_srs '+proj=aea +lat_1=4

    +lat_2=55 +lon_0=-35' sst_20181015_cropped.tif sst_20181015_projected.tif 3: Reproject (Albers Equal Area)
  16. EXAMPLE: SEA SURFACE TEMP https://coralreefwatch.noaa.gov/satellite/bleaching5km/index.php 4: Apply a color palette

    value R G B nv = no data $ gdaldem color-relief sst_20181015_projected.tif RdBu.txt sst_20181015_rgb.tif
  17. ANIMATION IS EASY Just do the previous steps a bunch

    of times for f in *.tif; do gdaldem color-relief “$f" Colors.txt “${f%.*}_rgb.tif” done
  18. …then make a gif (or video) ANIMATION IS EASY Just

    do the previous steps a bunch of times for f in *.tif; do gdaldem color-relief “$f" Colors.txt “${f%.*}_rgb.tif” done convert -delay 0 *_rgb.tif animation.gif
  19. MAKE A MAP SANDWICH Annotations (Illustrator, PS, …) Thematic layers

    (CLI, Python, …) Base map (GIS, Illustrator, …)
  20. Joshua Stevens [email protected] T H A N K Y O

    U ! Get in touch: @jscarto JoshuaStevens.net/contact