[gdal-dev] cutting up large TIFF files with gdal_translate
Even Rouault
even.rouault at mines-paris.org
Wed Aug 22 10:47:28 PDT 2012
Le mercredi 22 août 2012 18:43:12, Frank Warmerdam a écrit :
> On Wed, Aug 22, 2012 at 9:38 AM, Zoltan Szecsei <zoltans at geograph.co.za>
wrote:
> > Hi,
> > I have a large image bounded by:
> >
> > Upper Left ( 447007.599, 7132849.501) ( 32d28'15.03"E, 25d55'19.12"S)
> > Lower Left ( 447007.599, 7127851.511) ( 32d28'14.30"E, 25d58' 1.59"S)
> > Upper Right ( 451005.901, 7132849.501) ( 32d30'38.75"E, 25d55'19.63"S)
> > Lower Right ( 451005.901, 7127851.511) ( 32d30'38.08"E, 25d58' 2.10"S)
> >
> > and I would like to cut it up into 1Km squares starting on the 447000
> > 7133000 boundary.
> > The problem is that using:
> > gdal_translate -of JPEG -projwin $tlx $tly $brx $bry m_36s.tif
> > m_36s_${r}${c}.jpg
> >
> > gives me:
> > Computed -srcwin -152 97030 20008 20008 from projected window.
> > Computed -srcwin falls outside raster size of 79999x100001.
> >
> > Whilst the error is understandible, I was hoping that extra pixels would
> > be automatically inserted as no_data values to make up my 1km tiles.
>
> Zoltan,
>
> Unfortunately gdal_translate does not support this. Instead I'd
> suggest using gdalwarp:
>
> gdalwarp -te xmin ymin xmax ymax srcfile dstfile
>
> The "target extent" window may be off the source image without
> problem.
FYI, gdal_translate in trunk has been upgraded recently to support that.
More information about the gdal-dev
mailing list