0

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
ormat.
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?

UPDATE

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)
    driver_list.append(driver.GetDescription())

print(str(driver_list))

['VRT', 'DERIVED', 'GTiff', 'NITF', 'RPFTOC', 'ECRGTOC', 'HFA', 'SAR_CEOS', 'CEO
S', 'JAXAPALSAR', 'GFF', 'ELAS', 'AIG', 'AAIGrid', 'GRASSASCIIGrid', 'SDTS', 'DT
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
GR', 'GSAG', 'GSBG', 'GS7BG', 'COSAR', 'TSX', 'COASP', 'R', 'MAP', 'KMLSUPEROVER
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',
'ISCE', 'HTTP']
1

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."

|improve this answer|||||
  • I do not understand. Why gdalinfo and gdal_translate recognize ECW but python utilite gdal2tiles not recognize? – Kliver Max Feb 26 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. – Yjelza Feb 26 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 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 – Yjelza Feb 26 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 2 days ago

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.