Skip to content

Instantly share code, notes, and snippets.

@rustyb
Last active April 25, 2016 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rustyb/c7c178f8f0a7b071fe1050c5b8dad098 to your computer and use it in GitHub Desktop.
Save rustyb/c7c178f8f0a7b071fe1050c5b8dad098 to your computer and use it in GitHub Desktop.
GeoTIFF making notes for MapLesotho

First you will need to go and georeference your image. It will turn out absolutely massive, like 1.57GB.

With this image we will compress the file into a geoTiff with jpeg compression. Comes back as 45mb.

gdal_translate \
    HSPC0567_wgs84.jpg \
    out1.tiff \
    -co COMPRESS=JPEG \
    -co PHOTOMETRIC=YCBCR \
    -co TILED=YES

Now to create some overviews for this file so it can be viewed at low zoom levels.

gdaladdo \
  --config COMPRESS_OVERVIEW JPEG \
  --config PHOTOMETRIC_OVERVIEW YCBCR \
  --config INTERLEAVE_OVERVIEW PIXEL \
  -r average \
  out1.tif \
  2 4 8 16

Source -> http://blog.cleverelephant.ca/2015/02/geotiff-compression-for-dummies.html

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