id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 6516,Incorrect orientation of ECW with Y increasing downward,Mateusz Łoskot,Mateusz Łoskot,"TL:TR; ECW driver seems to assume ECW images are always oriented with Y coordinates increasing ""Upward"". {{{ // ecwdataset.cpp (r33717) adfGeoTransform[5] = -fabs(psFileInfo->fCellIncrementY); }}} It applies to both, GDAL 2.0.0 as well as the current trunk (GDAL 2.2.0dev). I have two **adjacent** ECW images: * 02QD472.ecw - with Y coordinates increasing ""Upward"" (Y resolution negative) * 02QD474.ecw - with Y coordinates increasing ""Downward"" (Y resolution positive) Both images are referenced in http://epsg.io/2444 (JGD2000 / Japan Plane Rectangular CS II). Attached screen shows the files info by ECWHeaderEditor from the latest [http://download.intergraph.com/downloads/erdas-apollo-essentials-utilities-2014-v14.01 ERDAS APOLLO Essentials Utilities 2014]). The problem is visible when inspecting corner coordinates with gdalinfo (trimmed output for clarity): * **02QD472.ecw** - **correct** coordinates reported {{{ Driver: ECW/ERDAS Compressed Wavelets (SDK 5.2) Files: ..\02QD472.ecw Origin = (-10000.100000000000364,-191999.899999999994179) Pixel Size = (0.200000000000000,-0.200000000000000) Corner Coordinates: Upper Left ( -10000.100, -191999.900) Lower Left ( -10000.100, -193499.900) Upper Right ( -8000.100, -191999.900) Lower Right ( -8000.100, -193499.900) Center ( -9000.100, -192749.900) }}} * **02QD474.ecw** - **incorrect** coordinates reported {{{ Driver: ECW/ERDAS Compressed Wavelets (SDK 5.2) Files: ..\02QD474.ecw Origin = (-10000.100000000000364,-194999.899999999994179) Pixel Size = (0.200000000000000,-0.200000000000000) Corner Coordinates: Upper Left ( -10000.100, -194999.900) Lower Left ( -10000.100, -196499.900) Upper Right ( -8000.100, -194999.900) Lower Right ( -8000.100, -196499.900) Center ( -9000.100, -195749.900) }}} Loading the two images with QGIS (screen attached) also shows, they are not adjacent. In order to fix it, patch is very simple: removed the `-fabs` call wraping the `fCellIncrementY` value. Once fixed, gdalinfo reports **correct** corner coordinates for the ""Downward"" **02QD474.ecw**: {{{ Driver: ECW/ERDAS Compressed Wavelets (SDK 5.2) Files: ..\02QD474.ecw Origin = (-10000.100000000000364,-194999.899999999994179) Pixel Size = (0.200000000000000,0.200000000000000) Corner Coordinates: Upper Left ( -10000.100, -194999.900) Lower Left ( -10000.100, -193499.900) Upper Right ( -8000.100, -194999.900) Lower Right ( -8000.100, -193499.900) Center ( -9000.100, -194249.900) }}} The two sample ECW images are 20MB each, so I here is the download URL to single 38MB .7z package with both of them: https://onedrive.live.com/redir?resid=54EB175E9AC78CE0!1483&authkey=!AMScTQpD5ytTmpQ&ithint=file%2c7z",defect,closed,normal,,default,svn-trunk,normal,fixed,ecw,