Dear community, I hope some of you might be of help here.

For weeks I’ve been trying to build CENTOS docker image (for AWS Lambda) for 
GDAL 3 + PROJ 6 but I stumbled into a strange behavior making my processes a 
couple time slower than with gdal 2. I’m using those images for dynamic tiling 
(warping + cropping) so my guess it there is something involving PROJ 6 here 
(everything works fine with gdal2.4 + proj 5. The weird things is I cannot 
reproduce the behavior outside my centos container (works fine with Alpine).

The full discovery can be seen in 
https://github.com/RemotePixel/amazonlinux/issues/10 
<https://github.com/RemotePixel/amazonlinux/issues/10> and 
https://github.com/RemotePixel/amazonlinux/issues/16 
<https://github.com/RemotePixel/amazonlinux/issues/16>. 

The dockerfile can be found here 
https://github.com/RemotePixel/amazonlinux/blob/master/base/gdal3.0/Dockerfile 
<https://github.com/RemotePixel/amazonlinux/blob/master/base/gdal3.0/Dockerfile>

The logs (PROJ or GDAL) don’t tell anything, they are almost similar. The only 
notable difference is :
```
# CENTOS
GDAL: GDALDriver::Create(GTiff,out.tif,256,256,1,UInt16,(nil))
# ALPINE 
GDAL: GDALDriver::Create(GTiff,out.tif,256,256,1,UInt16,0)
```

Here is an example showing the logs of a gdalwarp command (keeping only line 
taking more then 100ms). 

CPL_TIMESTAMP=ONE CPL_DEBUG=ON GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR gdalwarp 
-q -te -11036283.891926888 10331840.239250703 -10958012.374962866 
10410111.756214723-t_srs EPSG:3857 -ts 256 256 -r bilinear -overwrite 
/vsicurl/https://s3.amazonaws.com/opendata.remotepixel.ca/bench_tiler/LC08_L1TP_040013_20191014_20191029_01_T1_B4.tif
 out.tif
Note: time delta (column 2) is calculated between line and line+1 (meaning that 
delta assigned for  `GDAL : computing areas …` correspond to time spent 
somewhere between the end of GDALComputeAreaOfInterest  and 
`GDALWarpCreateOutput` 
https://github.com/OSGeo/gdal/blob/release/3.0/gdal/apps/gdalwarp_lib.cpp#L945-L1040
 
<https://github.com/OSGeo/gdal/blob/release/3.0/gdal/apps/gdalwarp_lib.cpp#L945-L1040>

GDAL 3.0
17:26:43.314265 264ms   HTTP: libcurl/7.61.1 OpenSSL/1.0.2k zlib/1.2.8 
libidn2/0.16 libpsl/0.6.2 (+libicu/50.1.2) libssh2/1.4.2 nghttp2/1.21.1
17:26:43.662722 671ms   GDAL: Computing area of interest: -103.586, 65.7283, 
-97.4556, 68.0874
17:26:44.460977 625ms   GTiff: Opened 134x135 overview.
17:26:45.088925 588ms   GDAL: Computing area of interest: -103.586, 65.7283, 
-97.4556, 68.0874
17:26:45.676688 189ms   VSICURL: Downloading 2145148-2175608 
(https://s3.amazonaws.com/opendata.remotepixel.ca/bench_tiler/LC08_L1TP_040013_20191014_20191029_01_T1_B4.tif)...
17:26:45.870161 124ms   GDAL: GDALWarpKernel()::GWKRealCase() 
Src=1544,201,252x252 Dst=0,0,256x256


GDAL 3.0 Alpine
17:42:55.857475 284ms   HTTP: libcurl/7.65.1 OpenSSL/1.1.1c zlib/1.2.11 
nghttp2/1.38.0
17:42:56.273597 43ms     GDAL: Computing area of interest: -103.586, 65.7283, 
-97.4556, 68.0874
17:42:56.421772 15ms        GTiff: Opened 134x135 overview.
17:42:56.440615 16ms     GDAL: Computing area of interest: -103.586, 65.7283, 
-97.4556, 68.0874
17:42:56.456941 210ms   VSICURL: Downloading 2145148-2175608 
(https://s3.amazonaws.com/opendata.remotepixel.ca/bench_tiler/LC08_L1TP_040013_20191014_20191029_01_T1_B4.tif)...
17:42:56.725692 44ms        GDAL: GDALWarpKernel()::GWKRealCase() 
Src=1544,201,252x252 Dst=0,0,256x256
Full logs: 
https://gist.github.com/vincentsarago/2c55d5154d352f10e85d09fe9008e365

The main time difference are just after `GDALComputeAreaOfInterest` 
(https://github.com/OSGeo/gdal/blob/release/3.0/gdal/apps/gdalwarp_lib.cpp#L930-L939
 and takes about 15 times more time in amazonlinux in comp)
arison to alpine 


I’m looking for advice for deeper debuting or for knowledge about 
compilation/dependencies of GDA/PROJ for centos. 

Thanks,

Vincent 
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to