I am trying to output the gdalinfo image statistics results into a text file with the following command:

gdalinfo image.tif>stats.txt 

The stats.txt file gets created, however it is empty. It does not contain any statistical information that is printed out in the command window, with the gdalinfo image.tif.

  • Which GDAL version are you using? It's a known issue: trac.osgeo.org/gdal/ticket/5073 and trac.osgeo.org/gdal/ticket/5128 – Antonio Falciano Nov 22 '13 at 9:18
  • GDAL 1.9.2, released 2012/10/08 - I am using this version, so in theory it should work? The links you provided are definately related, however I am not sure how to apply it. Where I should set the "Running Windows, I use a System.Diagnostics.Process to invoke GDALINFO with the STDOUT and STDERR redirected to a stream." Many thanks for your suggestions – meryloo Nov 22 '13 at 9:25
  • Firstly, you could update GDAL and verify if the issue persists. FYI I have the same issue with GDAL 1.10.1, released 2013/08/26. – Antonio Falciano Nov 22 '13 at 9:28
  • Had same problem in GDAL 1.11.1, released 2014/09/24. NOt sure if there is a better way, but until I need it I just renamed c:\GDALPATH\bin\gdal\plugins\gdal_ECW_JP2ECW.dll – Dennis May 21 '15 at 11:50

As I said in previous comments to the question, this is a known issue. A simple workaround consists into uninstalling the ECW extension. Furthermore, there's a (still open) ticket on GitHub which seems to suggest a solution. Upgrading to ECW 5.0 SDK (you can find it here) effectively solves this issue, however introduces others (e.g. no create method implemented for ECW format).

  • Many thanks afalciano! I have done 2 things, as suggested by you: (1) uninstalled ECW plugin in my 1.9 version of GDAL - the gdalinfo outputs to the text file and then (2) installed version 1.10.1 without ECW plugin. I can see from your answer there is a complete fix now with a new ECW plugin - many thanks for your help! – meryloo Nov 22 '13 at 9:57
  • Don't mention it! I had the same issue in past and didn't know how to solve it, thanks to you! – Antonio Falciano Nov 22 '13 at 10:01

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.