1

Before I start, if anyone considers this a duplicate, then that's fair enough, I'll not object, I do happen to think however that it's a question that I don't see a clear answer for either here or elsewhere.

What I need to do is to create a simple, flat set of tiles from a single large raster.

I'm aware that we have "gdal2tiles" in the os4gw toolset, but this insists on creating the simple features recommended folder structure which is not what I need to do.

I'm also aware that there are other tools (GDAL warp I think does it) that have the "Projection Window" option, allowing to extract only a given region, but for that to work I need to provide the geo co-ordinates on the command line, which means creating loops and increment things correctly, not a task that anyone working on windows really relishes :-)

I'm prepared to write my own tool if I have to, using either C and/or C# and the GDAL Libraries, but before I go down this route, I thought I'd ask here.

Put simply, is there a tool, or an option in the existing tools I may have missed that allows me to say:

c:>tilethisimage size=256x256 bigmap.tif

and end up with

tile-0-0.tif tile-1-0.tif tile-2-0.tif tile-3-0.tif tile-4-0.tif . . . . tile-0-20.tif tile-1-20.tif tile-2-20.tif tile-3-20.tif tile-4-20.tif

Or similar, in the current directory, without the complication of having to sort through folders, figure out zoom levels or anything else?

All I need is the larger image cut into tiles of the requested size, and with the correct geo-spatial reference data embedded in them. I don't need KML's, Virtual raster's, tab files, world files or anything else.

If it wasn't for the fact I needed to preserve the geo-spatial co-ordinate info and have those co-ordinates mapped correctly for the tile sizes, I would quite simply just use imagemagik to cut the image.

5
  • If you plan on going the C/C++ route this might be helpful: gdalsplit - the opposite of gdal_merge – Kersten Jan 3 '16 at 14:12
  • I think you could use gdal.org/gdal_retile.html – mdsumner Jan 3 '16 at 17:38
  • You probably don't want to cut on geo coordinates anyway - subject to round-off error, and you can miss a line. Do the cutting in image space. – BradHards Jan 3 '16 at 20:46
  • @mdsummer your suggestion totally works, I really should have paid more attention to the various py scripts. In general I tend to shy away from the py scripts on 64 bit windows, as python on WX64 is I find, very unstable. If you want to write your suggestion up as an answer, I'll mark it as accepted. – shawty Jan 3 '16 at 22:01
  • @BradHards - cutting via pixel size is what I was looking for, hence why I suggested using imagemagik, which I would have done if I didn't need to preserve the geospatial info present in the images. – shawty Jan 3 '16 at 22:03
2

I think you could use the "gdal_retile.py" script:

http://gdal.org/gdal_retile.html

:)

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.