3liz / docker-qgis-server

Build docker qgis tornado server image
6 stars 1 forks source link

Add ECW to GDAL #3

Open deregnab opened 5 years ago

deregnab commented 5 years ago

Hello,

I would like to add ecw lib to gdal inside the docker container. I managed to add ecw by recompiling gdal inside the docker.

I'm compiling gdal with this tutorial (with different paths and versions + I installed the required packages + I don't remove libgdal20): https://gist.github.com/1papaya/568c4580b1909071696c1cb119101823

When I try to access an ecw file stored on the server I get a request timeout error

Do I need to restart the server once gdal is recompiled?

dmarteau commented 5 years ago

Hi,

It seems that gdal load all loaders at startup then yes, you surely need to restart the server if you want your changes to be taken into account.

Anyway, a timeout error means than your requests probably failed because of a worker crash: you should have a look to the container logs for debug infos.

deregnab commented 5 years ago

Hello @dmarteau,

I'm not used to python webserver especially with the tornado framework, so I don't really know how to restart the server once the docker is started. How am I suppose to restart it while keeping the docker running? Or do I have to restart the docker once I added the ECW library?

Thank you in advance

dmarteau commented 5 years ago

Hi,

The container is a single application container, that is, restarting the service is the same as restarting the container, i.e:

docker restart <container_name> 
dmarteau commented 5 years ago

@deregnab In all case if you remove the container you will have to install your loaders again: the best option is to build a derived image that install your gdal loaders.

deregnab commented 5 years ago

Thanks a lot for your quick answer.

deregnab commented 5 years ago

Hello,

I think I managed to build my own image that added ecw to gdal.

I use your qgis-platform in its 3.6, I installed the packages needed for the install and I build my image.

I created a project (1 tif and 1 ecw) which is working properly in local : Capture d'écran du 2019-05-13 15 24 42

The container's build seems successful and the docker run is working but when I tried to read a project with an ecw file, I have the following message in the logs:

Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.
ERROR 4: `/projects/ecwFile.ecw' not recognized as a supported file format.
2019-05-13 13:53:08,125 WARNING [53]    Qgis: : 1 unavailable layers found:
2019-05-13 13:53:08,125 WARNING [53]    Qgis: :  * ./ecwFile.ecw
2019-05-13 13:53:08,126 INFO    [53]    Cache 'project.qgs' updated with path: /projects/project.qgs
2019-05-13 13:53:08,126 DEBUG   [53]    Cleaning config cache entry /projects/prkject.qgs
2019-05-13 13:53:08,126 INFO    [53]    Qgis: Server: MAP: map.qgs
2019-05-13 13:53:08,126 INFO    [53]    Qgis: Server: REQUEST:GetCapabilities
2019-05-13 13:53:08,126 INFO    [53]    Qgis: Server: SERVICE:WMS
2019-05-13 13:53:08,126 INFO    [53]    Qgis: Server: VERSION:1.3.0
2019-05-13 13:53:08,127 WARNING [53]    Qgis: : WMS capabilities document not found in cache
2019-05-13 13:53:08,131 WARNING [53]    Qgis: : Set WMS capabilities document in cache
2019-05-13 13:53:08,132 DEBUG   [53]    b'D;\x07\xf0u\x82\x11\xe9\x8e-\x02B\xac\x11\x00\x07': Flushing response data: (5908 bytes)
2019-05-13 13:53:08,132 INFO    [53]    Qgis: Server: Request finished in 6 ms
2019-05-13 13:53:08,132 DEBUG   [36]    SND worker: b'D;\x07\xf0u\x82\x11\xe9\x8e-\x02B\xac\x11\x00\x07' -> client: b'OWS-SERVER-1' : b"pB+@u\x86\x11\xe9\x8f'\x02B\xac\x11\x00\x07"
2019-05-13 13:53:08,133 DEBUG   [36]    READY b'D;\x07\xf0u\x82\x11\xe9\x8e-\x02B\xac\x11\x00\x07'
2019-05-13 13:53:08,133 RREQ    [1]     200 GET ?MAP=+map.qgs&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetCapabilities 37  5908    
2019-05-13 13:53:08,133 REQ [1] Myip    200 GET /ows/?MAP=%20map.qgs&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetCapabilities  37  5908    Mozilla/5.0 QGIS/3.6.2-Noosa    

I can't use either tif or ecw file but if I remove the ecw from the project, I can access the tif file

Thanks in advance

dmarteau commented 5 years ago

Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples. ERROR 4: `/projects/ecwFile.ecw' not recognized as a supported file format.

These are Gdal errors, AMHA there is maybe a problem with your gdal installation in the container. Try to use gdal tools (gdalinfo etc...) to check your data in a running container.

deregnab commented 5 years ago

Hello,

You were right the issue lies in ecw installation for gdal, I made a mistake while choosing ecw's license option and didn't take the server one.

So it's no wonder that the server wasn't working properly.

Thanks for your time

deregnab commented 5 years ago

Hello,

I think I managed to install gdal with ecw properly on the container, however, ecw is skipped when used with qgis-server.

I know there is a GDAL_SKIP variable that I tried to modify in order to avoid the skip but it didn't work at all and I don't know how to resolve it or if it's even possible.

I also tried with qgis' older versions and with an old version(SDK3.3 instead of SDK5.4) of ecw too and I got 2 behaviors :

Thanks in advance

dmarteau commented 5 years ago

@deregnab This appears to be a very Qgis specific issue that is going beyond my knowlegde, I think that you should address the issue to Qgis mailing list: https://lists.osgeo.org/mailman/listinfo/qgis-developer.