I have GDAL 2.4.2 plus ECW plugin.

gdalinfo --formats
>>ECW -raster- (rw): ERDAS Compressed Wavelets (SDK 3.x)

And gdalinfo shows ecw file info.
But when i tried to use gdal2tiles i got error:

"C:\Program Files\GDAL\gdal2tiles.py" -r near -a 0,0,0 -z 15 D:\OFP\input.ecw D:\dev\nginx-1.12.1\www\OFP

ERROR 4: `D:\OFP\input.ecw' not recognized as a supported file f
Usage: gdal2tiles.py [options] input_file [output]

gdal2tiles.py: error: It is not possible to open the input file 'D:\OFP\input.ecw'.

What can be wrong here?


I found that gdal module do not know about this format:

from osgeo import gdal

driver_list = []
for i in range(gdal.GetDriverCount()):
    driver = gdal.GetDriver(i)


ED', 'PNG', 'JPEG', 'MEM', 'JDEM', 'GIF', 'BIGGIF', 'ESAT', 'BSB', 'XPM', 'BMP',
 'DIMAP', 'AirSAR', 'RS2', 'SAFE', 'PCIDSK', 'PCRaster', 'ILWIS', 'SGI', 'SRTMHG
T', 'Leveller', 'Terragen', 'ISIS3', 'ISIS2', 'PDS', 'PDS4', 'VICAR', 'TIL', 'ER
S', 'JP2OpenJPEG', 'L1B', 'FIT', 'GRIB', 'RMF', 'WCS', 'WMS', 'MSGN', 'RST', 'IN
LAY', 'PDF', 'Rasterlite', 'MBTiles', 'PLMOSAIC', 'CALS', 'WMTS', 'SENTINEL2', '
MRF', 'PNM', 'DOQ1', 'DOQ2', 'PAux', 'MFF', 'MFF2', 'FujiBAS', 'GSC', 'FAST', 'B
T', 'LAN', 'CPG', 'IDA', 'NDF', 'EIR', 'DIPEx', 'LCP', 'GTX', 'LOSLAS', 'NTv1',
'NTv2', 'CTable2', 'ACE2', 'SNODAS', 'KRO', 'ROI_PAC', 'RRASTER', 'BYN', 'ARG',
'RIK', 'USGSDEM', 'GXF', 'NWT_GRD', 'NWT_GRC', 'ADRG', 'SRP', 'BLX', 'PostGISRas
ter', 'SAGA', 'IGNFHeightASCIIGrid', 'XYZ', 'HF2', 'OZI', 'CTG', 'E00GRID', 'ZMa
p', 'NGSGEOID', 'IRIS', 'PRF', 'RDA', 'EEDAI', 'EEDA', 'SIGDEM', 'GNMFile', 'GNM
Database', 'DB2ODBC', 'ESRI Shapefile', 'MapInfo File', 'UK .NTF', 'OGR_SDTS', '
S57', 'DGN', 'OGR_VRT', 'REC', 'Memory', 'BNA', 'CSV', 'NAS', 'GML', 'GPX', 'LIB
KML', 'KML', 'GeoJSON', 'GeoJSONSeq', 'ESRIJSON', 'TopoJSON', 'Interlis 1', 'Int
erlis 2', 'OGR_GMT', 'GPKG', 'SQLite', 'ODBC', 'WAsP', 'PGeo', 'MSSQLSpatial', '
PostgreSQL', 'MySQL', 'OpenFileGDB', 'XPlane', 'DXF', 'CAD', 'Geoconcept', 'GeoR
SS', 'GPSTrackMaker', 'VFK', 'PGDUMP', 'OSM', 'GPSBabel', 'SUA', 'OpenAir', 'OGR
_PDS', 'WFS', 'WFS3', 'HTF', 'AeronavFAA', 'Geomedia', 'EDIGEO', 'GFT', 'SVG', '
CouchDB', 'Cloudant', 'Idrisi', 'ARCGEN', 'SEGUKOOA', 'SEGY', 'ODS', 'XLSX', 'El
asticSearch', 'Walk', 'Carto', 'SXF', 'Selafin', 'JML', 'PLSCENES', 'CSW', 'VDV'
, 'GMLAS', 'MVT', 'TIGER', 'AVCBin', 'AVCE00', 'NGW', 'GenBin', 'ENVI', 'EHdr',

Judging by :https://gdal.org/drivers/raster/ecw.html

You'll need the ECW SDK which will probably mean that you'll have to compile GDAL yourself.

Specifically: "GDAL supports reading and writing ECW files using the ERDAS ECW/JP2 SDK developed by Hexagon Geospatial (formerly Intergraph, ERDAS, ERMapper). Support is optional and requires linking in the libraries available from the ECW/JP2 SDK Download page."

  • I do not understand. Why gdalinfo and gdal_translate recognize ECW but python utilite gdal2tiles not recognize?
    – Kliver Max
    Feb 26 '20 at 11:55
  • I can't confirm, but possibly because gdal2tiles.py is a python file, it might not have been compiled with ECW support, while the .exe's might have been compiled with support. You might want to try using gdal_translate to change the ECW into a different file format and see if that works.
    – Francis
    Feb 26 '20 at 12:01
  • Usually i donwload gdal from http://www.gisinternals.com/ and here is ecw plugin for gdal. And after install this exe utils starts to work with this format. How to change python utilites to they starts to work with ecw. I'd already tried to translate ecw to tiff. But gdal said taht output tiff file will take 500gb of disk space, so this solution not work for me.
    – Kliver Max
    Feb 26 '20 at 12:09
  • Try: gdal_translate -of GTiff -co “COMPRESS=LZW” -co “PREDICTOR=2” -co “TILED=YES” Path\To\INFILENAME.ecw Path\To\OUTPUT.tiff This will create a compressed tiff that should take up a lot less space
    – Francis
    Feb 26 '20 at 14:14
  • In the end i found that all my tries of converting ecw into tif give a low resolution results. And the idea of this convertation is pointless.
    – Kliver Max
    Apr 1 '20 at 9:10

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.