[Qgis-user] [gdal-dev] converting ECW to GTiff for Linux

Carlos López PSIG carlos.lopez at psig.es
Sun Mar 5 10:30:54 PST 2017


Hi,
I usually run the next bat process:

*REM*
*set SRC=25831*
*REM*
*REM start for*
*REM*
*for /R %%f in (*.ecw) do (*
*REM*
*REM convert to geotif*
*REM*
*call C:\OSGeo4W64\bin\gdal_translate -a_srs EPSG:%SRC% "%%f" "%%~dpnf.tif"
-co COMPRESS=JPEG -co JPEG_QUALITY=60 -co BLOCKXSIZE=128 -co BLOCKYSIZE=128*
*REM*
*REM create pyramides*
*REM*
*call C:\OSGeo4W64\bin\gdaladdo -r average --config COMPRESS_OVERVIEW JPEG
--config PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL
--config JPEG_QUALITY_OVERVIEW 80 "%%~dpnf.tif" 2 4 8 16 32 64 128 256*
*REM*
*REM end for*
*REM*
*)*

​the result are very fine for us!​

Regards,


* <http://www.psig.es>*

*Carlos López Quintanilla*

www.psig.es
carlos.lopez at psig.es
+34 699.680.261

Nota legal: Este mensaje y cualquier archivo adjunto está destinado
únicamente a la
persona a quien se dirige y es confidencial. Si usted ha recibido este
mensaje por
error, por favor, comuníqueselo al remitente y bórrelo inmediatamente. La
utilización ,
revelación y/o reproducción del mensaje puede constituir un delito.

Protección de Datos: Le informamos que sus datos de contacto electrónico se
hallan
incorporados a un fichero titularidad de CARLOS LÓPEZ QUINTANILLA, al
objeto de
envío de información, respuesta a consultas y contactos genéricos.
Puede ejercer los derechos de acceso, rectificación, cancelación y
oposición que
establece la LOPD en cualquier momento, mediante escrito, acompañado de
copia de
documento oficial que le identifique, dirigido a CARLOS LÓPEZ QUINTANILLA
CL. P
arellada, 8 E2 de Corbera de Llobregat, 08757-Barcelona.

También podrá oponerse a nuestros envíos de comunicaciones comerciales
(Art.21.2
de la LSSI) a través de la siguiente dirección de correo electrónico:
admin at psig.es


2017-03-04 22:27 GMT+01:00 Micha Silver <tsvibar at gmail.com>:

>
>
> On 03/04/2017 09:42 PM, Even Rouault wrote:
>
>>
>> On samedi 4 mars 2017 18:55:03 CET Micha Silver wrote:
>>
>> > Hello:
>>
>> > (I'm double posting as this problem is somewhere between GDAL and QGIS.)
>>
>> >
>>
>> > I have converted an ECW compressed aerial photo to geotiff with JPEG
>>
>> > compression on a Windows computer with gdal_translate. The resulting tif
>>
>> > image displays fine with QGIS on the Windows machine.  GDAL version
>> 2.1.3
>>
>> > on the Windows computer, and QGIS 2.18.4 My command was similar to:
>>
>> > gdal_translate -of GTiff -projwin ..... -co TILED=YES -co TFW=YES -co
>>
>> > COMPRESS=JPEG -co PHOTOMETRIC=YCBCR in.ecw out.tif
>>
>> >
>>
>> > I then copy the tif (and tfw) to my Linux machine, and try to open with
>>
>> > QGIS, but QGIS crashes immediately. I should note that gdalinfo shows
>> full
>>
>> > information on both the Windows and Linux systems. On the Linux computer
>>
>> > GDAL is 2.1.2 and QGIS is 2.18.4 .
>>
>> On the Linux system where this crashes with QGIS, could you do :
>>
>> gdalinfo -checksum -stats the.tif
>>
>> If this crashes, the issue is clearly in GDAL. Otherwise it is likely in
>> QGIS.
>>
>> No crash, but I do see a Warning:
>
> gdalinfo -checksum -stats kidron_e2.tif Driver: GTiff/GeoTIFF Files:
> kidron_e2.tif Size is 45200, 36000 ....
>
> Warning 1: JPEGLib:Premature end of JPEG file Minimum=0.000,
> Maximum=255.000, Mean=163.947, StdDev=38.307 Checksum=49932 Metadata:
> STATISTICS_MAXIMUM=255 STATISTICS_MEAN=163.94735676131
> STATISTICS_MINIMUM=0 STATISTICS_STDDEV=38.30668730016 Band 2
> Block=256x256 Type=Byte, ColorInterp=Green Description = Green
> Minimum=0.000, Maximum=255.000, Mean=167.305, StdDev=32.125 Checksum=52
> Metadata: STATISTICS_MAXIMUM=255 STATISTICS_MEAN=167.3047566274
> STATISTICS_MINIMUM=0 STATISTICS_STDDEV=32.124800654502 Band 3
> Block=256x256 Type=Byte, ColorInterp=Blue Description = Blue Minimum=0.000,
> Maximum=255.000, Mean=146.241, StdDev=31.604 Checksum=11457 Metadata:
> STATISTICS_MAXIMUM=255 STATISTICS_MEAN=146.24062233882
> STATISTICS_MINIMUM=0 STATISTICS_STDDEV=31.603809219917
>
> Also I have found that creating overlays seems to solve the problem (?!).
> After running:
>
> gdaladdo --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW
> YCBCR --config INTERLEAVE_OVERVIEW PIXEL -r average kidron_e2.tif 2 4 8 16
>
> the tiff opens fine in QGIS.
>
> Regards,
>
> Micha
>
> >
>>
>> > Any ideas what could be the cause of QGIS crashing with the
>> gdal_translate
>>
>> > converted tif image? Is there something that needs to be done on
>> windows to
>>
>> > create a Linux usable geotiff??
>>
>> >
>>
>> > Thanks
>>
>> --
>>
>> Spatialys - Geospatial professional services
>>
>> http://www.spatialys.com
>>
>>
> --
> Micha Silver
> cell: +972-523-665918
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170305/87aeaadb/attachment.html>


More information about the Qgis-user mailing list