DHI/terracotta

terracotta is not serving correctly a large cog file

ghislainv opened this issue · 12 comments

Hi,

I have a large (7.5Go) cog file for Asia at https://forestatrisk.cirad.fr/tropics/tif/prob_2020_ASI_merc.tif. I have checked that this is a valid cog file. This file is perfectly well displayed using QGis and /vsicurl/.

However, I am not able to display it correctly using terracotta. This problem is observed either with terracotta serve or configuring terracotta with apache and gunicorn. See an example of the problem with leaflet here: https://forestatrisk.cirad.fr/maps.html. Only a part of the raster is displayed and the part displayed changes with the zoom level.

Other large cogs files for America and Africa are well displayed with the exact same approach.

Configuration:
terracotta v0.8.2.dev1+g1a60e00
gunicorn 21.2.0
python 3.11.6
apache/2.4.56 (Debian)

I have done the following trials to fix this issue without success:

  • reinstalling terracotta and gunicorn.
  • ingesting rasters with Python API in place of the command line.

Sincerely

Do you see any errors in the server logs?

Dear @dionhaefner. Thanks for considering this issue. Do you mean in the apache or the gunicorn server logs, or both ?
The thing is that even without apache and gunicorn installed, there is a problem with terracotta serve.

I'm afraid you will have to be more specific than that. What problem?

Either log that contains error messages would be helpful, gunicorn logs should be a good place to start.

Dear @dionhaefner,

I have no errors in the gunicorn logs:

❯ tail -f /home/www/forestatrisk/tropics/tif/error_log_gunicorn.txt 
[2023-11-30 16:11:00 +0100] [1574877] [INFO] Starting gunicorn 21.2.0
[2023-11-30 16:11:00 +0100] [1574877] [INFO] Listening at: unix:terracotta.sock (1574877)
[2023-11-30 16:11:00 +0100] [1574877] [INFO] Using worker: sync
[2023-11-30 16:11:00 +0100] [1574980] [INFO] Booting worker with pid: 1574980
[2023-11-30 16:11:00 +0100] [1574984] [INFO] Booting worker with pid: 1574984
[2023-11-30 16:11:00 +0100] [1574985] [INFO] Booting worker with pid: 1574985
[2023-11-30 16:11:00 +0100] [1574992] [INFO] Booting worker with pid: 1574992
[2023-11-30 16:11:00 +0100] [1574993] [INFO] Booting worker with pid: 1574993

Regarding Apache, I have the following logs. They contain errors but I have difficulties interpreting them:

root@minervois:/home/www/forestatrisk/tropics/tif# tail -f /var/log/apache2/forestatrisk.cirad.fr-error_log 
[Wed Nov 29 23:56:43.021482 2023] [proxy_fcgi:error] [pid 1553723] [client 198.244.200.160:57560] AH01071: Got error 'Primary script unknown'
[Thu Nov 30 03:07:18.929283 2023] [:error] [pid 1559705] [client 87.250.224.224:55128] [client 87.250.224.224] ModSecurity: Warning. Pattern match "(?:<(?:TITLE>Index of.*?<H|title>Index of.*?<h)1>Index of|>\\\\[To Parent Directory\\\\]<\\\\/[Aa]><br>)" at RESPONSE_BODY. [file "/usr/share/modsecurity-crs/rules/RESPONSE-950-DATA-LEAKAGES.conf"] [line "50"] [id "950130"] [msg "Directory Listing"] [data "Matched Data: <title>Index of /tropics/tif</title>\\x0a </head>\\x0a <body>\\x0a<h1>Index of found within RESPONSE_BODY: <!DOCTYPE HTML PUBLIC \\x22-//W3C//DTD HTML 3.2 Final//EN\\x22>\\x0a<html>\\x0a <head>\\x0a  <title>Index of /tropics/tif</title>\\x0a </head>\\x0a <body>\\x0a<h1>Index of /tropics/tif</h1>\\x0a  <table>\\x0a   <tr><th valign=\\x22top\\x22><img src=\\x22/icons/blank.gif\\x22 alt=\\x22[ICO]\\x22></th><th><a href=\\x22?C=N;O=D\\x22>Name</a></th><th><a href=\\x22?C=M;O=A\\x22>Last modified</a></th><th><a href=\\..."] [severity "ERROR"] [ver "OWASP_CRS/3.3.0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-disclosure"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/118/116/54/127"] [tag "PCI/6.5.6 [hostname "forestatrisk.cirad.fr"] [uri "/tropics/tif/"] [unique_id "ZWfuVvY2oEuAMeD-9l5mSAAAAAY"]
[Thu Nov 30 03:07:18.930129 2023] [:error] [pid 1559705] [client 87.250.224.224:55128] [client 87.250.224.224] ModSecurity: Warning. Operator GE matched 4 at TX:outbound_anomaly_score. [file "/usr/share/modsecurity-crs/rules/RESPONSE-959-BLOCKING-EVALUATION.conf"] [line "76"] [id "959100"] [msg "Outbound Anomaly Score Exceeded (Total Score: 4)"] [ver "OWASP_CRS/3.3.0"] [tag "anomaly-evaluation"] [hostname "forestatrisk.cirad.fr"] [uri "/tropics/tif/"] [unique_id "ZWfuVvY2oEuAMeD-9l5mSAAAAAY"]
[Thu Nov 30 03:07:18.930489 2023] [:error] [pid 1559705] [client 87.250.224.224:55128] [client 87.250.224.224] ModSecurity: Warning. Operator GE matched 4 at TX:outbound_anomaly_score. [file "/usr/share/modsecurity-crs/rules/RESPONSE-980-CORRELATION.conf"] [line "102"] [id "980140"] [msg "Outbound Anomaly Score Exceeded (score 4): individual paranoia level scores: 4, 0, 0, 0"] [ver "OWASP_CRS/3.3.0"] [tag "event-correlation"] [hostname "forestatrisk.cirad.fr"] [uri "/tropics/tif/"] [unique_id "ZWfuVvY2oEuAMeD-9l5mSAAAAAY"]
[Thu Nov 30 10:31:35.703921 2023] [:error] [pid 1569176] [client 54.36.148.65:42709] [client 54.36.148.65] ModSecurity: Warning. Pattern match "(?:<(?:TITLE>Index of.*?<H|title>Index of.*?<h)1>Index of|>\\\\[To Parent Directory\\\\]<\\\\/[Aa]><br>)" at RESPONSE_BODY. [file "/usr/share/modsecurity-crs/rules/RESPONSE-950-DATA-LEAKAGES.conf"] [line "50"] [id "950130"] [msg "Directory Listing"] [data "Matched Data: <title>Index of /tropics/tif</title>\\x0a </head>\\x0a <body>\\x0a<h1>Index of found within RESPONSE_BODY: <!DOCTYPE HTML PUBLIC \\x22-//W3C//DTD HTML 3.2 Final//EN\\x22>\\x0a<html>\\x0a <head>\\x0a  <title>Index of /tropics/tif</title>\\x0a </head>\\x0a <body>\\x0a<h1>Index of /tropics/tif</h1>\\x0a  <table>\\x0a   <tr><th valign=\\x22top\\x22><img src=\\x22/icons/blank.gif\\x22 alt=\\x22[ICO]\\x22></th><th><a href=\\x22?C=N;O=A\\x22>Name</a></th><th><a href=\\x22?C=M;O=A\\x22>Last modified</a></th><th><a href=\\..."] [severity "ERROR"] [ver "OWASP_CRS/3.3.0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-disclosure"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/118/116/54/127"] [tag "PCI/6.5.6 [hostname "forestatrisk.cirad.fr"] [uri "/tropics/tif/"] [unique_id "ZWhWd5FXkHF-bRzZuuFVJwAAAAQ"]
[Thu Nov 30 10:31:35.705328 2023] [:error] [pid 1569176] [client 54.36.148.65:42709] [client 54.36.148.65] ModSecurity: Warning. Operator GE matched 4 at TX:outbound_anomaly_score. [file "/usr/share/modsecurity-crs/rules/RESPONSE-959-BLOCKING-EVALUATION.conf"] [line "76"] [id "959100"] [msg "Outbound Anomaly Score Exceeded (Total Score: 4)"] [ver "OWASP_CRS/3.3.0"] [tag "anomaly-evaluation"] [hostname "forestatrisk.cirad.fr"] [uri "/tropics/tif/"] [unique_id "ZWhWd5FXkHF-bRzZuuFVJwAAAAQ"]
[Thu Nov 30 10:31:35.705755 2023] [:error] [pid 1569176] [client 54.36.148.65:42709] [client 54.36.148.65] ModSecurity: Warning. Operator GE matched 4 at TX:outbound_anomaly_score. [file "/usr/share/modsecurity-crs/rules/RESPONSE-980-CORRELATION.conf"] [line "102"] [id "980140"] [msg "Outbound Anomaly Score Exceeded (score 4): individual paranoia level scores: 4, 0, 0, 0"] [ver "OWASP_CRS/3.3.0"] [tag "event-correlation"] [hostname "forestatrisk.cirad.fr"] [uri "/tropics/tif/"] [unique_id "ZWhWd5FXkHF-bRzZuuFVJwAAAAQ"]
[Thu Nov 30 13:02:32.849462 2023] [:error] [pid 1570339] [client 161.111.35.1:51251] [client 161.111.35.1] ModSecurity: Warning. Pattern match "(?:<(?:TITLE>Index of.*?<H|title>Index of.*?<h)1>Index of|>\\\\[To Parent Directory\\\\]<\\\\/[Aa]><br>)" at RESPONSE_BODY. [file "/usr/share/modsecurity-crs/rules/RESPONSE-950-DATA-LEAKAGES.conf"] [line "50"] [id "950130"] [msg "Directory Listing"] [data "Matched Data: <title>Index of /tropics/tif</title>\\x0a </head>\\x0a <body>\\x0a<h1>Index of found within RESPONSE_BODY: <!DOCTYPE HTML PUBLIC \\x22-//W3C//DTD HTML 3.2 Final//EN\\x22>\\x0a<html>\\x0a <head>\\x0a  <title>Index of /tropics/tif</title>\\x0a </head>\\x0a <body>\\x0a<h1>Index of /tropics/tif</h1>\\x0a  <table>\\x0a   <tr><th valign=\\x22top\\x22><img src=\\x22/icons/blank.gif\\x22 alt=\\x22[ICO]\\x22></th><th><a href=\\x22?C=N;O=D\\x22>Name</a></th><th><a href=\\x22?C=M;O=A\\x22>Last modified</a></th><th><a href=\\..."] [severity "ERROR"] [ver "OWASP_CRS/3.3.0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-disclosure"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/118/116/54/127"] [tag "PCI/6.5.6 [hostname "forestatrisk.cirad.fr"] [uri "/tropics/tif/"] [unique_id "ZWh52E6KJfY9ww6JF5E_ZQAAABU"], referer: https://forestatrisk.cirad.fr/rasters.html
[Thu Nov 30 13:02:32.850301 2023] [:error] [pid 1570339] [client 161.111.35.1:51251] [client 161.111.35.1] ModSecurity: Warning. Operator GE matched 4 at TX:outbound_anomaly_score. [file "/usr/share/modsecurity-crs/rules/RESPONSE-959-BLOCKING-EVALUATION.conf"] [line "76"] [id "959100"] [msg "Outbound Anomaly Score Exceeded (Total Score: 4)"] [ver "OWASP_CRS/3.3.0"] [tag "anomaly-evaluation"] [hostname "forestatrisk.cirad.fr"] [uri "/tropics/tif/"] [unique_id "ZWh52E6KJfY9ww6JF5E_ZQAAABU"], referer: https://forestatrisk.cirad.fr/rasters.html
[Thu Nov 30 13:02:32.850675 2023] [:error] [pid 1570339] [client 161.111.35.1:51251] [client 161.111.35.1] ModSecurity: Warning. Operator GE matched 4 at TX:outbound_anomaly_score. [file "/usr/share/modsecurity-crs/rules/RESPONSE-980-CORRELATION.conf"] [line "102"] [id "980140"] [msg "Outbound Anomaly Score Exceeded (score 4): individual paranoia level scores: 4, 0, 0, 0"] [ver "OWASP_CRS/3.3.0"] [tag "event-correlation"] [hostname "forestatrisk.cirad.fr"] [uri "/tropics/tif/"] [unique_id "ZWh52E6KJfY9ww6JF5E_ZQAAABU"], referer: https://forestatrisk.cirad.fr/rasters.html

However, I am not sure the problem comes from gunicorn or apache as there is the same problem with terracotta serve, which, if I correctly understand, does not rely on gunicorn nor apache.

Regards,

Ghislain

Okay, can you post the output of terracotta serve, then?

Please update the logs here or format them in a way that preserves line breaks.

This is the output of the terracotta serve command. I cannot spot any errors.

> terracotta serve --debug -d /home/www/forestatrisk/tropics/tif/terracotta.sqlite
 * Serving Flask app 'terracotta.server'
 * Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://localhost:5000
Press CTRL+C to quit
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 131-620-182
127.0.0.1 - - [30/Nov/2023 19:54:19] "GET /keys HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:19] "GET /swagger.json HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:22] "GET /keys HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:22] "GET /datasets?limit=15&page=0 HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:22] "GET /metadata/fcc/123/AFR HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:22] "GET /metadata/fcc/123/ASI HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:22] "GET /metadata/fcc/123/AME HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:23] "GET /metadata/fcc/2050/AME HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:23] "GET /metadata/fcc/2050/AFR HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:24] "GET /metadata/fcc/2050/ASI HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:24] "GET /metadata/fcc/2100/AFR HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:25] "GET /metadata/fcc/2100/AME HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:26] "GET /metadata/fcc/2100/ASI HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:26] "GET /metadata/prob/2020/AFR HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:26] "GET /metadata/prob/2020/AME HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:26] "GET /metadata/prob/2020/ASI HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/preview.png?tile_size=[128,128] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/2/1/1.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/2/1/2.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/2/2/0.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/2/1/0.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/2/0/0.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/2/3/0.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/2/2/1.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/2/2/2.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:34] "GET /singleband/prob/2020/ASI/2/3/1.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/2/3/2.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/2/0/1.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/2/0/2.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/3/6/3.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/3/5/3.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/3/6/4.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/3/5/4.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/3/7/3.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/3/7/4.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/3/0/3.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:54:35] "GET /singleband/prob/2020/ASI/3/0/4.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/13/7.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/13/8.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/14/7.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/14/8.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/12/7.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/13/6.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/14/6.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/12/8.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/15/7.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/13/9.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/15/8.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/14/9.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/12/6.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/15/6.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/12/9.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/15/9.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/11/7.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/11/8.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/0/7.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/0/8.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/11/6.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:40] "GET /singleband/prob/2020/ASI/4/11/9.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:43] "GET /singleband/prob/2020/ASI/4/0/8.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:43] "GET /singleband/prob/2020/ASI/4/0/7.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:43] "GET /singleband/prob/2020/ASI/4/0/9.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/29/16.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/29/17.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/29/15.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/28/16.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/28/17.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/28/15.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/30/16.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/27/16.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/30/15.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/30/17.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/27/15.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/27/17.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/29/14.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/28/14.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/30/14.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:46] "GET /singleband/prob/2020/ASI/5/27/14.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:47] "GET /singleband/prob/2020/ASI/5/26/16.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:47] "GET /singleband/prob/2020/ASI/5/26/15.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:47] "GET /singleband/prob/2020/ASI/5/26/17.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:47] "GET /singleband/prob/2020/ASI/5/26/14.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:50] "GET /singleband/prob/2020/ASI/5/25/15.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:50] "GET /singleband/prob/2020/ASI/5/25/14.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:50] "GET /singleband/prob/2020/ASI/5/25/16.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:50] "GET /singleband/prob/2020/ASI/5/25/17.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:55] "GET /singleband/prob/2020/ASI/5/29/18.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:55] "GET /singleband/prob/2020/ASI/5/31/16.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:55] "GET /singleband/prob/2020/ASI/5/28/18.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:55] "GET /singleband/prob/2020/ASI/5/30/18.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:55] "GET /singleband/prob/2020/ASI/5/31/17.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:55] "GET /singleband/prob/2020/ASI/5/31/15.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:55] "GET /singleband/prob/2020/ASI/5/31/18.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:55] "GET /singleband/prob/2020/ASI/5/31/14.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:56] "GET /singleband/prob/2020/ASI/6/55/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:56] "GET /singleband/prob/2020/ASI/6/56/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:56] "GET /singleband/prob/2020/ASI/6/55/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:56] "GET /singleband/prob/2020/ASI/6/56/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:56] "GET /singleband/prob/2020/ASI/6/54/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:56] "GET /singleband/prob/2020/ASI/6/55/30.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:56] "GET /singleband/prob/2020/ASI/6/56/30.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/54/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/57/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/54/30.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/55/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/57/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/56/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/57/30.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/54/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/53/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/53/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/57/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/53/30.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/58/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/58/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/58/30.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/53/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:57] "GET /singleband/prob/2020/ASI/6/58/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:59] "GET /singleband/prob/2020/ASI/6/58/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:55:59] "GET /singleband/prob/2020/ASI/6/58/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:00] "GET /singleband/prob/2020/ASI/6/59/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:00] "GET /singleband/prob/2020/ASI/6/59/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:00] "GET /singleband/prob/2020/ASI/6/58/34.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:00] "GET /singleband/prob/2020/ASI/6/59/34.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:00] "GET /singleband/prob/2020/ASI/6/57/34.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:00] "GET /singleband/prob/2020/ASI/6/56/34.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:00] "GET /singleband/prob/2020/ASI/6/60/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:00] "GET /singleband/prob/2020/ASI/6/60/34.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:00] "GET /singleband/prob/2020/ASI/6/60/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:02] "GET /singleband/prob/2020/ASI/6/61/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:02] "GET /singleband/prob/2020/ASI/6/61/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:02] "GET /singleband/prob/2020/ASI/6/61/34.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:02] "GET /singleband/prob/2020/ASI/6/61/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:02] "GET /singleband/prob/2020/ASI/6/62/34.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:02] "GET /singleband/prob/2020/ASI/6/62/32.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:02] "GET /singleband/prob/2020/ASI/6/62/33.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/60/35.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/59/35.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/61/35.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/62/35.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/58/35.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/57/35.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/60/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/59/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/62/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/6/61/31.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -
127.0.0.1 - - [30/Nov/2023 19:56:04] "GET /singleband/prob/2020/ASI/5/31/15.png?colormap=greys&stretch_range=[2,55615.25] HTTP/1.1" 200 -

Thanks, I can reproduce the problem. I'll have a look at what's going on.

OK, thanks a lot. I tried with the following raster for the same region in another projection (ESRI:102028, albers equal area): https://forestatrisk.cirad.fr/tropics/tif/prob_2020_ASI_aea.tif.

In this case, the raster is displayed only for Zoom=0.

The bounds of the raster span across the antimeridian (180deg longitude). This is currently not supported by Terracotta, see #53. To fix this, clip your raster to remove the parts that reach across the antimeridian.

On second thought, there might be something else at play here. The raster is definitely odd; if I understand correctly it actually spans the entire globe in zonal direction, with the vast majority masked out.

Clipping the raster to a reasonable region should definitely work, but I'm wondering if Terracotta could fall back to some sane behavior to handle this case.

Dear @dionhaefner , thanks for your messages and effort.

I will try with clipping the raster to a reasonable region.

Also, the raster in Albers equal area (https://forestatrisk.cirad.fr/tropics/tif/prob_2020_ASI_aea.tif) does not cross the antimeridian if considering coordinates in this projection. But the gdalinfo command returns a surprising result showing different coordinates (one East, one West) for xmax in lat/long (171d22'45.77"E and 177d46'13.13"W) while xmax=5523810.000 in Albers equal area:

> gdalinfo /vsicurl/https://forestatrisk.cirad.fr/tropics/tif/prob_2020_ASI_aea.tif 
Driver: GTiff/GeoTIFF
Files: /vsicurl/https://forestatrisk.cirad.fr/tropics/tif/prob_2020_ASI_aea.tif
Size is 384405, 213564
Coordinate System is:
PROJCRS["unknown",
    BASEGEOGCRS["WGS 84",
        DATUM["World Geodetic System 1984",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4326]],
    CONVERSION["Albers Equal Area",
        METHOD["Albers Equal Area",
            ID["EPSG",9822]],
        PARAMETER["Latitude of false origin",-15,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",125,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",7,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",-32,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]]
Data axis to CRS axis mapping: 1,2
Origin = (-6008340.000000000000000,4643310.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND
  LAYOUT=COG
  PREDICTOR=2
Corner Coordinates:
Upper Left  (-6008340.000, 4643310.000) ( 74d38' 8.96"E, 33d38'47.63"N)
Lower Left  (-6008340.000,-1763610.000) ( 62d54'23.09"E, 24d24'27.24"S)
Upper Right ( 5523810.000, 4643310.000) (171d22'45.77"E, 32d41' 2.35"N)
Lower Right ( 5523810.000,-1763610.000) (177d46'13.13"W, 25d17'49.32"S)
Center      ( -242265.000, 1439850.000) (122d43'38.29"E,  2d39'26.17"S)
Band 1 Block=256x256 Type=UInt16, ColorInterp=Gray
  NoData Value=0
  Overviews: 192203x106782, 96102x53391, 48051x26696, 24026x13348, 12013x6674, 6007x3337

So the problem might come from the original projection of the raster (Albers equal area, ESRI: 102028) which leads to a raster crossing the antimeridian when reprojected in Lat/Long .

Note that this raster (at least the one in the Mercator projection, EPSG: 3857) was displayed correctly with a previous version of terracotta. I think it was version v0.7.2 but I would need to reinstall this version to be sure. Sorry, I realize that I might have underlined this before.

Anyway, from my side, I think you can close this issue as it is definitely a raster problem rather than an issue with terracotta.

Thanks again for helping me and for your work developing this great package.

Sincerely,

I have clipped the raster so that it does not cross the anti-meridian and it is now correctly displayed with terracotta:
https://forestatrisk.cirad.fr/maps.html

I have used the following gdal command to crop the raster:

gdal_translate -projwin 8036480 3981450 20037480 -3539340 -projwin_srs EPSG:3857 -of COG -co COMPRESS=DEFLATE -co PREDICTOR=YES -co BIGTIFF=YES <input_file.tif> <output_file.tif>

Thanks again,