Open-EO / openeo-earthengine-driver

openEO back-end driver for Google Earth Engine.
Apache License 2.0
21 stars 7 forks source link

Polygon filtering throws internal error #23

Closed jneijt closed 5 years ago

jneijt commented 5 years ago

I've tried limiting the data loaded from a collection using a polygon stored in a GeoJSON, but the backend keeps throwing an internal server error. The same happens when filtering using the filter_polygon process later on in the process graph.

{
    "id": "1565604135372",
    "code": "Internal",
    "message": "Server error: Commons.filterPolygons is not a function",
    "url": "https://open-eo.github.io/openeo-api/errors/#openeo-error-codes"
}

Is my process graph or GeoJSON somehow incorrect, or is this an issue on the backend?

The process graph I used to test this:

{
  "dc": {
    "process_id": "load_collection",
    "arguments": {
      "id": "COPERNICUS/S2",
      "spatial_extent": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    7.246856689453125,
                    47.167543112150554
                  ],
                  [
                    7.218189239501953,
                    47.13520594493793
                  ],
                  [
                    7.23552703857422,
                    47.11570074493338
                  ],
                  [
                    7.2803306579589835,
                    47.11488300552253
                  ],
                  [
                    7.305736541748048,
                    47.14793302647546
                  ],
                  [
                    7.279300689697265,
                    47.16999386399103
                  ],
                  [
                    7.246856689453125,
                    47.167543112150554
                  ]
                ]
              ]
            }
          }
        ]
      },
      "temporal_extent": [
        "2019-08-12",
        "2019-08-01"
      ],
      "bands": [
        "B4",
        "B8"
      ]
    }
  },
  "save": {
    "process_id": "save_result",
    "arguments": {
      "data": {
        "from_node": "dc"
      },
      "format": "PNG"
    },
    "result": true
  }
}
m-mohr commented 5 years ago

Hi Joep,

thanks for reporting this issue. It is mostly a server-side issue, which I just fixed.

Nevertheless, your process graph won't work as such. There are some steps missing to get the data into a format PNG can handle. Here's a process graph that would work:

{
  "1": {
    "process_id": "load_collection",
    "arguments": {
      "id": "COPERNICUS/S2",
      "spatial_extent": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    7.246856689453125,
                    47.167543112150554
                  ],
                  [
                    7.218189239501953,
                    47.13520594493793
                  ],
                  [
                    7.23552703857422,
                    47.11570074493338
                  ],
                  [
                    7.2803306579589835,
                    47.11488300552253
                  ],
                  [
                    7.305736541748048,
                    47.14793302647546
                  ],
                  [
                    7.279300689697265,
                    47.16999386399103
                  ],
                  [
                    7.246856689453125,
                    47.167543112150554
                  ]
                ]
              ]
            }
          }
        ]
      },
      "temporal_extent": [
        "2019-08-01",
        "2019-08-12"
      ],
      "bands": [
        "B4",
        "B8"
      ]
    }
  },
  "4": {
    "process_id": "reduce",
    "arguments": {
      "data": {
        "from_node": 7
      },
      "reducer": {
        "callback": {
          "min": {
            "arguments": {
              "data": {
                "from_argument": "data"
              }
            },
            "process_id": "min",
            "result": true
          }
        }
      },
      "dimension": "temporal"
    }
  },
  "5": {
    "process_id": "save_result",
    "arguments": {
      "data": {
        "from_node": 8
      },
      "format": "png"
    },
    "result": true
  },
  "7": {
    "process_id": "normalized_difference_fast",
    "arguments": {
      "data": {
        "from_node": 1
      },
      "band1": "B4",
      "band2": "B8"
    }
  },
  "8": {
    "process_id": "apply",
    "arguments": {
      "data": {
        "from_node": 4
      },
      "process": {
        "callback": {
          "2": {
            "process_id": "linear_scale_range",
            "arguments": {
              "x": {
                "from_argument": "x"
              },
              "inputMin": -1,
              "inputMax": 1,
              "outputMax": 255
            },
            "result": true
          }
        }
      }
    }
  }
}
jneijt commented 5 years ago

Hi Matthias,

Thank you very much for fixing this issue that quickly! I tested it in the application and it works perfectly.