Skip to content

Instantly share code, notes, and snippets.

@bmount
Created February 9, 2013 01:05
Show Gist options
  • Save bmount/4743305 to your computer and use it in GitHub Desktop.
Save bmount/4743305 to your computer and use it in GitHub Desktop.
reminder about breaking up huge National Agricultural Imagery Program (NAIP) tif files
# coding: utf-8
import os
# naip SF collection in geotiff from gdalinfo via mrsiddecode:
xmax = 72260
ymax = 21650
x = xmax
y = 21650
tmp = """gdal_translate -of PNG -srcwin {0} {1} 2000 2000 sf2012.tif bigslice/sf_partial-{2}.png"""
while x > 0:
while y > 0:
os.system(tmp.format(x, y, str(x)+'-'+str(y)))
y -= 2000
y = ymax
x -= 2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment