1

I have 607 aerial images of Massachusetts in .jp2 format. They are in a mosaic however I need to break down the 607 images into groupings of 16(4x4) spatially so that I can more easily process Massachusetts as a whole.

I've been told that using gdal could help but I am not sure.

Has anyone succeeded in a similar task?

1
  • Welcome to gis.SE. We might be able to help you with what you really want to know if we knew what you really want to achieve. For example, what processing do you want to do? Do your groups of 16 need to overlap for that processing to make sense? Can you update the question (just click edit between the bottom of your question and the top of the his comment) to include this detail?
    – BradHards
    Jan 25 '14 at 0:28
2

Building a virtual raster would be the best solution. I did it with 300 Dutch topo maps as described here:

How practical is this workflow, tiling from a complex, multi-step GDAL VRT?

1

You can use the gdalwarp utility (http://www.gdal.org/gdalwarp.html) to subset an image, the command would be something like:

gdalwarp -te tilexmin tileymin tilexmax tileymax \
-t_srs targetproj.wkt \
-of GTiff \
bigmosaic.tiff smalltile.tif

Where 'targetproj.wkt' is a well known text file file containing the output projection (this can be the same as the input projection).

If you wrote a script to iterate through the image this would provide an easy way of splitting into tiles.

There is also a function in the open source library RSGISLib to do this: http://rsgislib.org/rsgislib_imageutils.html?highlight=createtiles#rsgislib.imageutils.createTiles

#!/usr/bin/env python
import rsgislib
from rsgislib import imageutils
inputImage = './Rasters/injune_p142_casi_sub_utm.kea'
outBase = './TestOutputs/Tiles/injune_p142_casi_sub_utm'
width = 100
height = width
overlap = 5
offsettiling = 0 
format = 'KEA'
dataType = rsgislib.TYPE_32INT
ext='kea'
imageutils.createTiles(inputImage, outBase, width, height, overlap, offsettiling, gdalformat, dataType, ext)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.