I'm working on windows 7 64 bits, postgis 2.01. I have to import ECW files into my PostGIS database. Unfortunately, my PostGIS seems to has been compiled without gdal ecw support.When i do a raster2pgsql -G, ECW does not appears.

I have tried to follow instructions erected in this following post :
How to add ECW support to GDAL bundled with PostGIS Windows

So I paste the raster2pgsql.exe into my C:\Program Files\PostgreSQL\9.1\gdal-data folder. And i paste gdal19.dll from C:\Program Files (x86)\Quantum GIS Lisboa\bin toward C:\Program Files\PostgreSQL\9.1\bin. I rename the dll like libgdal-1.dll.

But it does not work and i can't import ecw with raster2pgsql.I have an error message saying : application error.For information/. Moreover, when i do a SELECT postgis_full_version();

"POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.1, released 2012/05/15"

And my qgis 's gdal has been also compiled with gdal 1.9.1.

Moreover, for information, my GDAL_DATA (environment system variable) pointed to C:\Program Files\PostgreSQL\9.1\gdal-data

How do I use ECW with PostGIS?

I have to use this ECW format. My client give to me data with this format and I did not convert raw data in ECW with a proprietary software.

1 Answer 1


The workaround is to use another GDAL that has ECW compiled and convert to a format that raster2pgsql supports. I suggest looking at the SDK. Those are built whenever a change in GDAL and have ECW support I believe.

Unfortunately the gdal that raster2pgsql is packaged with is incompatible with the VC+ build ones and the gdal just has the basic formats that don't require us adding extra depency files. So you can't just replace the gdal dll.

We are the package maintainers for windows PostGIS. Others have voiced similar issue. We are planning to in future have a version of gdal built with VC that is swappable for those who need it.

We don't plan to compile proprietary support in the stackbuilder distributed GDAL for obvious reasons and also it makes the packaging not as light weight.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.