Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am hoping to come up with a script that would allow me to mosaic imagery into a polygon tile grid. My hopes is to do this with gdal or QGIS. I am wondering if anyone knows of an existing script, before I start. My first thoughts was to use gdal_merge, but I do not see a variable for using a polygon (shapefile) as the boundary. gdal_merge does have the -ul_lr function, so I know that it will work on subsets of images.

What I am looking to do is the following: From a source of ortho imagery, transfer any and all pixels that intersect with the tile grid, then move on to the next grid. There may be 10 source images (for example) that are large in size (geographic extent and disks space) that would be used to populate the individual grid tiles (ie: 1km X 1km).

Thanks....

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I would build a GDAL virtual image using (something like):

gdalbuildvrt myimage.vrt images/*.tif

and then tile that using either gdal2tiles or gdal_retile:

gdal2tiles.py myimage.vrt outputDir

or

gdal_retile.py -tileIndex tileIndexName myimage.vrt 
share|improve this answer
    
I have had no luck with this. I have tried to use FWTools, MSYS Shell, and the .py in command prompt with no luck. When I run the gdal_retile.py in command prompt or FWTools, it gives a line error of the script. When I try to use MSYS Shell is says it can not find the file, even when I am dragging it in from explorer. Thoughts? –  Ryan Garnett Sep 5 '13 at 23:07
    
I just tried it in OSGeo4W Administrator and it worked. I the command needed the output folder as a variable. Here is the command: gdal_retile -of GTiff -tileIndex <tile.shp> -r cubic -targetDir <tiled folder> merge.vrt –  Ryan Garnett Sep 5 '13 at 23:13
    
When I review the tiling, it is not to the tile grid shape. The output tiles are squared, and not cut to the input tile boundaries. –  Ryan Garnett Sep 5 '13 at 23:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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