[gdal-dev] Slice Large GeoTiff into 1 Degree Tiles

Even Rouault even.rouault at mines-paris.org
Mon Nov 25 13:47:01 PST 2013


Le lundi 25 novembre 2013 22:38:45, Metzen a écrit :
> I have a bunch of large GeoTiff files (1.4GB, 4 latitude degrees x 8
> longitude degrees).
> 
> I need to slice each one up into 1 degree lat x 1 degree long tiles (with
> just a little bit of overage in each).
> 
> Here is the gdalinfo output for one of the GeoTiff files:
> 
> Driver: GTiff/GeoTIFF
> Files: index.tif
> Size is 38401, 19201
> Coordinate System is:
> GEOGCS["WGS 84",
>     DATUM["WGS_1984",
>         SPHEROID["WGS 84",6378137,298.257223563,
>             AUTHORITY["EPSG","7030"]],
>         AUTHORITY["EPSG","6326"]],
>     PRIMEM["Greenwich",0],
>     UNIT["degree",0.0174532925199433],
>     AUTHORITY["EPSG","4326"]]
> Origin = (-112.000104166666674,56.000104166666667)
> Pixel Size = (0.000208333333333,-0.000208333333333)
> Metadata:
>   AREA_OR_POINT=Area
> Image Structure Metadata:
>   INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left  (-112.0001042,  56.0001042) (112d 0' 0.38"W, 56d 0' 0.37"N)
> Lower Left  (-112.0001042,  51.9998958) (112d 0' 0.38"W, 51d59'59.62"N)
> Upper Right (-103.9998958,  56.0001042) (103d59'59.62"W, 56d 0' 0.37"N)
> Lower Right (-103.9998958,  51.9998958) (103d59'59.62"W, 51d59'59.62"N)
> Center      (-108.0000000,  54.0000000) (108d 0' 0.00"W, 54d 0' 0.00"N)
> Band 1 Block=38401x1 Type=Int16, ColorInterp=Gray
>   NoData Value=-32767
> 
> I want everything to be the same except the size. So each one needs to be
> sliced into 32 tiles, each 1 degree x 1 degree.
> 
> For instance one would cover:
> -112.0001042, 56.0001042 to -110.9998958, 54.9998958 (essentially -112, 56
> to -111, 55).
> 
> I see utilities like gdal_retile.py and gdal_grid, but I'm not making
> progress.
> 
> Is there a gdal tool that can do what I need?   If so, which one(s), and
> can you share an example command?

gdal_translate with the -projwin option and a small loop written in your 
preferred scription language should do it.

> 
> 
> 
> 
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Slice-Large-GeoTiff-into-1-Degree-Tile
> s-tp5091122.html Sent from the GDAL - Dev mailing list archive at
> Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list