Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geotiff viewer works if data has (10,-10) resolution but not if (10,10) #280

Closed
clausmichele opened this issue Sep 26, 2022 · 7 comments
Closed
Labels
bug Something isn't working upstream
Milestone

Comments

@clausmichele
Copy link
Member

I guess this is a bug.
When using the Eurac back-end, the result of this graph is showed correctly:

{
  "parameters": [],
  "process_graph": {
    "apply1": {
      "process_id": "apply",
      "arguments": {
        "process": {
          "process_graph": {
            "linearscalerange1": {
              "result": true,
              "process_id": "linear_scale_range",
              "arguments": {
                "inputMax": 2500,
                "inputMin": 0,
                "x": {
                  "from_parameter": "x"
                },
                "outputMax": 255
              }
            }
          }
        },
        "data": {
          "from_node": "reducedimension2"
        }
      }
    },
    "loadcollection1": {
      "process_id": "load_collection",
      "arguments": {
        "temporal_extent": [
          "2017-07-01T00:00:00Z",
          "2017-07-31T23:59:59Z"
        ],
        "spatial_extent": {
          "east": 11.369805822041744,
          "south": 46.48845353041921,
          "north": 46.50385828131181,
          "west": 11.318964117236685
        },
        "id": "S2_L2A_T32TPS",
        "bands": [
          "B04_10m",
          "B03_10m",
          "B02_10m"
        ]
      }
    },
    "reducedimension2": {
      "process_id": "reduce_dimension",
      "arguments": {
        "data": {
          "from_node": "loadcollection1"
        },
        "reducer": {
          "process_graph": {
            "min1": {
              "result": true,
              "process_id": "min",
              "arguments": {
                "data": {
                  "from_parameter": "data"
                }
              }
            }
          }
        },
        "dimension": "t"
      }
    },
    "saveresult1": {
      "result": true,
      "process_id": "save_result",
      "arguments": {
        "data": {
          "from_node": "apply1"
        },
        "format": "GTIFF"
      }
    }
  }
}

this instead, where the result comes from a different collection, shows just a black box. The difference between the two geotiffs is the resolution, which on the not working one is (10,10) instead of (10,-10).

{
  "parameters": [],
  "process_graph": {
    "apply1": {
      "process_id": "apply",
      "arguments": {
        "process": {
          "process_graph": {
            "linearscalerange1": {
              "result": true,
              "process_id": "linear_scale_range",
              "arguments": {
                "inputMax": 2500,
                "inputMin": 0,
                "x": {
                  "from_parameter": "x"
                },
                "outputMax": 255
              }
            }
          }
        },
        "data": {
          "from_node": "reducedimension2"
        }
      }
    },
    "loadcollection1": {
      "process_id": "load_collection",
      "arguments": {
        "temporal_extent": [
          "2017-07-01T00:00:00Z",
          "2017-07-31T23:59:59Z"
        ],
        "spatial_extent": {
          "east": 11.369805822041744,
          "south": 46.48845353041921,
          "north": 46.50385828131181,
          "west": 11.318964117236685
        },
        "id": "S2_L2A_ALPS",
        "bands": [
          "B04",
          "B03",
          "B02"
        ]
      }
    },
    "reducedimension2": {
      "process_id": "reduce_dimension",
      "arguments": {
        "data": {
          "from_node": "loadcollection1"
        },
        "reducer": {
          "process_graph": {
            "min1": {
              "result": true,
              "process_id": "min",
              "arguments": {
                "data": {
                  "from_parameter": "data"
                }
              }
            }
          }
        },
        "dimension": "t"
      }
    },
    "saveresult1": {
      "result": true,
      "process_id": "save_result",
      "arguments": {
        "data": {
          "from_node": "apply1"
        },
        "format": "GTIFF"
      }
    }
  }
}

Fixing the collection resolution solves the issue, but I wonder if it shouldn't cause a problem in the viewer.

@clausmichele
Copy link
Member Author

In the meanwhile I applied a workaround, to make sure that the y dimension has decreasing values and therefore negative resolution: Open-EO/openeo_odc_driver@d865cfb
Now it works fine on our back-end, but maybe we should still address this issue.

@m-mohr
Copy link
Member

m-mohr commented Sep 27, 2022

Thanks Michele. Can you send me an example file for testing purposes? I assume this is an upstream issue in OL or geotiff.js and I'll need to provide an example if I open an issue with them.

@clausmichele
Copy link
Member Author

Sure! Not working:
image
Working:
image
tiff_samples.zip

@m-mohr m-mohr added the bug Something isn't working label Sep 27, 2022
@m-mohr m-mohr added this to the v0.12 milestone Sep 27, 2022
@m-mohr m-mohr self-assigned this Oct 18, 2022
@m-mohr
Copy link
Member

m-mohr commented Oct 27, 2022

@clausmichele I've just tested this in pure OpenLayers and it also doesn't work there so this is an upstream issue.
I'm just wondering what does a negative resolution mean? Is that valid? Anyway, this is something to report to the openlayers guys...

@clausmichele
Copy link
Member Author

In this case the positive resolution for y is the issue. Anyway, most of the time there is a positive resolution along x and a negative along y. However, a geoTIFF can contain theoretically any combination of them.

@m-mohr
Copy link
Member

m-mohr commented Oct 27, 2022

Okay, I've submitted a bug report: openlayers/openlayers#14238

@m-mohr m-mohr removed their assignment Nov 10, 2022
@m-mohr
Copy link
Member

m-mohr commented Nov 10, 2022

Looks like a bug in geotiff.js: geotiffjs/geotiff.js#337

@m-mohr m-mohr modified the milestones: v0.12, v0.13 Dec 8, 2022
@m-mohr m-mohr modified the milestones: v0.13, v0.14 Jul 11, 2024
@m-mohr m-mohr closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

2 participants