Skip to content

Instantly share code, notes, and snippets.

@fawcett
Last active August 29, 2015 14:01
Show Gist options
  • Save fawcett/85768e466fdc19dddcfa to your computer and use it in GitHub Desktop.
Save fawcett/85768e466fdc19dddcfa to your computer and use it in GitHub Desktop.
Merging DOQ Tiles for large image
Notes on creating a large image from USGS DOQ tiles.
The image tiles are JPEG2000 compressed 5000 x 5000 px images. (~120 of them)
A vrt was create using GDAL build vrt:
gdalbuildvrt -input_file_list filelist.txt img_index.vrt
The output image was created using gdal_translate
gdal_translate img_index.vrt mpls7575.jp2 -outsize 75% 75% -of JP2OpenJPEG -co QUALITY=75 --config GDAL_MAX_DATASET_POOL_SIZE 10
A lower quality test image was created with:
gdal_translate img_index.vrt mpls34.jp2 -outsize 10% 10% -of JP2OpenJPEG -co QUALITY=25 --config GDAL_MAX_DATASET_POOL_SIZE 10
The final image is a combo of large size, but lower quality:
gdal_translate img_index.vrt mpls7525.jp2 -outsize 75% 75% -of JP2OpenJPEG -co QUALITY=25 --config GDAL_MAX_DATASET_POOL_SIZE 10
--------
In order to speed up the process of final image creation, one of the input image tiles was reprocessed to output a GeoTiff with internal tiles (default 256x256). It took roughly 10 minutes for the 5000x5000 px input tile. The original .jp2 file was 42 MB and the output .tif was 76 MB.
gdal_translate 15TVK755785_201203_0x3000m_CL_1.jp2 755785.tif -of GTiff -co "TILED=YES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment