Opened 12 years ago

Closed 12 years ago

#4532 closed defect (fixed)

gdal_retile.py does not pass creation options to the output driver

Reported by: jcrepetto Owned by: warmerdam
Priority: normal Milestone: 1.9.1
Component: Utilities Version: 1.9.0
Severity: normal Keywords:
Cc:

Description

I have tried this command to create tiles in ECW format :

gdal_retile.py -of ECW -ps 175 175 -co TARGET=90 -targetDir tiles land_shallow_topo_350.ecw

But it gives this error message for each tile created :

Warning 6: Driver MEM does not support TARGET creation option

It seems that the creation options are passed to a MEM driver instead of the ECW driver. I attach the input file to this ticket.

Attachments (1)

land_shallow_topo_350.ecw (63.8 KB ) - added by jcrepetto 12 years ago.
Sample file

Download all attachments as: .zip

Change History (7)

by jcrepetto, 12 years ago

Attachment: land_shallow_topo_350.ecw added

Sample file

comment:1 by Jukka Rahkonen, 12 years ago

The problem may be relevant but the command probably is not for any practical purpose. I cannot see any sense in making 175x175 pixel sized tiles in ECW format because one fundamental advantage in ECW (and JPEG2000) is that the format itself makes pyramid layers and tiles unnecessary. Test if -co creation options are passed on to geotiff or png tiles. If not then it is a real issue.

comment:2 by jcrepetto, 12 years ago

This file was just a small example that I created for the bug report. In a real case, I have a huge ECW file that I need to break into smaller files. If you can read French, look at this discussion : http://ttmaps.free.fr/forums/viewtopic.php?f=37&t=495&start=43 .

Anyway, there is the same problem with PNG :

gdal_retile.py -of PNG -ps 175 175 -co WORLDFILE=YES -targetDir tiles land_shallow_topo_350.ecw
Warning 6: Driver MEM does not support WORLDFILE creation option
Warning 6: Driver MEM does not support WORLDFILE creation option

comment:3 by Jukka Rahkonen, 12 years ago

I had to convert the sample ECW into tiff first and run gdal_retile with -of PNG -co WORLDFILE=YES as a separate run. I did get the same warnings about Driver MEM. However, in the tiles directory I do have both the png files and corresponding world files. Thus -co options are used OK but the MEM driver warnings are misleading.

I can't still understand why you would like to split a huge ecw file into smaller ones with gdal_retile but I believe you have a reason for it. Huge ECW files were OK for me and Mapserver as they were until the new ECW license forced us to convert all our ECW images into bigtiffs with internal jpeg compression.

comment:4 by jcrepetto, 12 years ago

In the case of ECW files, the -co options are not working :

$ gdal_retile.py -of ECW -ps 175 175 -co TARGET=60 -targetDir tiles land_shallow_topo_350.ecw
Warning 6: Driver MEM does not support TARGET creation option
Warning 6: Driver MEM does not support TARGET creation option

$ ls -l tiles
-rw------- 1 jcr jcr 30119 28 févr. 17:58 land_shallow_topo_350_1_1.ecw
-rw------- 1 jcr jcr 36004 28 févr. 17:58 land_shallow_topo_350_1_2.ecw

$ rm tiles/*

$ gdal_retile.py -of ECW -ps 175 175 -co TARGET=90 -targetDir tiles land_shallow_topo_350.ecw
Warning 6: Driver MEM does not support TARGET creation option
Warning 6: Driver MEM does not support TARGET creation option

$ ls -l tiles
total 68
-rw------- 1 jcr jcr 30119 28 févr. 17:59 land_shallow_topo_350_1_1.ecw
-rw------- 1 jcr jcr 36004 28 févr. 17:59 land_shallow_topo_350_1_2.ecw

As you can see, the sizes of the output files are exactly the same.

comment:5 by Even Rouault, 12 years ago

The warnings are just safe to ignore. I've just committed a fix in r24037 that should silent them.

Note that I've also observed that the TARGET option has no effect on too small tiles (128x128), but if you generate larger tiles (512x512), it works. But this is not related to the the above fix. It is a behaviour of the ECW compression.

comment:6 by jcrepetto, 12 years ago

Milestone: 1.9.1
Resolution: fixed
Status: newclosed

Thanks. You are right, the options were passed to the output driver. That proves that it is not always a good idea to work with small sample files.

Note: See TracTickets for help on using tickets.