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

shapely AssertionError in Anomaly_Detection process #314

Closed
bossie opened this issue Jan 19, 2023 · 4 comments
Closed

shapely AssertionError in Anomaly_Detection process #314

bossie opened this issue Jan 19, 2023 · 4 comments
Assignees

Comments

@bossie
Copy link
Collaborator

bossie commented Jan 19, 2023

Pratichhya Sharma:

Hello!! Can you please help me with [500] Internal: Server error: AssertionError()? I am trying to prepare a usecase for anomaly detection and using field polygons through WFS. Also, please find the notebook attached here, if incase the issue is how I fetch the data. But I encounter this error when testing for a few crop types, such as:

Test 1 on Grasland: In this case, I used the entire dataset that contained 58 polygons which failed and gave "[500] Internal: Server error: AssertionError() (ref: r-5c471e3b2e0b4823b0860bd2c74ee6e2)".
(job-id: j-0e32653401ed46f59ce70053616be4c5)

Test 2 on Zomergerst: For this, there were 16 polygons, and it executed well without any error. (job-id = j-938d42909a144f40bec59ffb70a5753a)

Test 3 on Grasland subset: I assumed the error as it said server error could be due to a large dataset, so I tested over a subset of 10 each. Initially, it ran well until subset[50:57](job-id = j-38b042ea56944bc7a5d712c04a362d57), which again shows the same error. Then I further divided it, and it ran well, indicating no error.

The stack trace with the AssertionError (j-38b042ea56944bc7a5d712c04a362d57):

Traceback (most recent call last):
  File "batch_job.py", line 577, in <module>
    main(sys.argv)
  File "batch_job.py", line 354, in main
    run_driver()
  File "batch_job.py", line 325, in run_driver
    run_job(
  File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/utils.py", line 49, in memory_logging_wrapper
    return function(*args, **kwargs)
  File "batch_job.py", line 413, in run_job
    result = ProcessGraphDeserializer.evaluate(process_graph, env=env, do_dry_run=tracer)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 337, in evaluate
    return convert_node(result_node, env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 349, in convert_node
    process_result = apply_process(process_id=process_id, args=processGraph.get('arguments', {}),
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in apply_process
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in <dictcomp>
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 361, in convert_node
    return convert_node(processGraph['node'], env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 349, in convert_node
    process_result = apply_process(process_id=process_id, args=processGraph.get('arguments', {}),
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1565, in apply_process
    return process_function(args=args, env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 201, in process_function
    return _evaluate_process_graph_process(
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1699, in _evaluate_process_graph_process
    return evaluate(process_graph, env=env, do_dry_run=False)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 337, in evaluate
    return convert_node(result_node, env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 349, in convert_node
    process_result = apply_process(process_id=process_id, args=processGraph.get('arguments', {}),
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in apply_process
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in <dictcomp>
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 361, in convert_node
    return convert_node(processGraph['node'], env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 349, in convert_node
    process_result = apply_process(process_id=process_id, args=processGraph.get('arguments', {}),
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in apply_process
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in <dictcomp>
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 361, in convert_node
    return convert_node(processGraph['node'], env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 349, in convert_node
    process_result = apply_process(process_id=process_id, args=processGraph.get('arguments', {}),
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in apply_process
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in <dictcomp>
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 361, in convert_node
    return convert_node(processGraph['node'], env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 349, in convert_node
    process_result = apply_process(process_id=process_id, args=processGraph.get('arguments', {}),
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in apply_process
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in <dictcomp>
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 361, in convert_node
    return convert_node(processGraph['node'], env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 349, in convert_node
    process_result = apply_process(process_id=process_id, args=processGraph.get('arguments', {}),
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in apply_process
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1470, in <dictcomp>
    args = {name: convert_node(expr, env=env) for (name, expr) in sorted(args.items())}
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 361, in convert_node
    return convert_node(processGraph['node'], env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 349, in convert_node
    process_result = apply_process(process_id=process_id, args=processGraph.get('arguments', {}),
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1565, in apply_process
    return process_function(args=args, env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 540, in load_collection
    return env.backend_implementation.catalog.load_collection(collection_id, load_params=load_params, env=env)
  File "/opt/venv/lib64/python3.8/site-packages/openeo/util.py", line 362, in wrapper
    return f(*args, **kwargs)
  File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/layercatalog.py", line 111, in load_collection
    return self._load_collection_cached(collection_id, load_params, WhiteListEvalEnv(env,WHITELIST))
  File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/layercatalog.py", line 221, in _load_collection_cached
    projected_polygons = to_projected_polygons(
  File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/utils.py", line 231, in to_projected_polygons
    GeometryCollection(list(geometry.get_geometries())),
  File "/opt/venv/lib64/python3.8/site-packages/shapely/geometry/collection.py", line 43, in __init__
    geom, n = geos_geometrycollection_from_py(geoms)
  File "/opt/venv/lib64/python3.8/site-packages/shapely/geometry/collection.py", line 68, in geos_geometrycollection_from_py
    assert(isinstance(ob[l], BaseGeometry))
AssertionError

The process graph (j-38b042ea56944bc7a5d712c04a362d57):

{
  "process_graph": {
    "AnomalyDetection1": {
      "process_id": "Anomaly_Detection",
      "arguments": {
        "date": [
          "2020-03-06",
          "2020-06-30"
        ],
        "polygon": {
          "type": "FeatureCollection",
          "features": [
            {
              "id": "50",
              "type": "Feature",
              "properties": {
                "ALVID": 1016148556,
                "GEWASGROEP": "Grasland",
                "HFDTLT": "60",
                "LBLHFDTLT": "Grasland",
                "LBLPM": " ",
                "OIDN": 765982,
                "PM": " ",
                "UIDN": 2669863,
                "index": 8765
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      5.29417821,
                      51.16171798
                    ],
                    [
                      5.29415133,
                      51.16173122
                    ],
                    [
                      5.2935942,
                      51.16200572
                    ],
                    [
                      5.29351241,
                      51.16195033
                    ],
                    [
                      5.29349958,
                      51.16194164
                    ],
                    [
                      5.29318106,
                      51.16172598
                    ],
                    [
                      5.29351095,
                      51.16158002
                    ],
                    [
                      5.29356126,
                      51.16155831
                    ],
                    [
                      5.29383743,
                      51.16143914
                    ],
                    [
                      5.29417821,
                      51.16171798
                    ]
                  ]
                ]
              }
            },
            {
              "id": "51",
              "type": "Feature",
              "properties": {
                "ALVID": 1058912018,
                "GEWASGROEP": "Grasland",
                "HFDTLT": "60",
                "LBLHFDTLT": "Grasland",
                "LBLPM": " ",
                "OIDN": 1042729,
                "PM": " ",
                "UIDN": 2673343,
                "index": 9052
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      5.21026127,
                      51.14327016
                    ],
                    [
                      5.21019195,
                      51.1438901
                    ],
                    [
                      5.2101723,
                      51.14388377
                    ],
                    [
                      5.21012479,
                      51.14386442
                    ],
                    [
                      5.21009989,
                      51.14385427
                    ],
                    [
                      5.21008966,
                      51.14384948
                    ],
                    [
                      5.21006885,
                      51.14383994
                    ],
                    [
                      5.21006058,
                      51.14382983
                    ],
                    [
                      5.21001412,
                      51.14382307
                    ],
                    [
                      5.20998341,
                      51.14381419
                    ],
                    [
                      5.20969485,
                      51.14374092
                    ],
                    [
                      5.20968437,
                      51.14373821
                    ],
                    [
                      5.20960665,
                      51.14371539
                    ],
                    [
                      5.20959429,
                      51.1437118
                    ],
                    [
                      5.20938904,
                      51.1436462
                    ],
                    [
                      5.20920185,
                      51.14358344
                    ],
                    [
                      5.20918966,
                      51.14358092
                    ],
                    [
                      5.20918421,
                      51.14357979
                    ],
                    [
                      5.20917368,
                      51.14357761
                    ],
                    [
                      5.20917453,
                      51.14357421
                    ],
                    [
                      5.20931952,
                      51.14295192
                    ],
                    [
                      5.2093303,
                      51.14295304
                    ],
                    [
                      5.20946267,
                      51.14296573
                    ],
                    [
                      5.20946893,
                      51.14294556
                    ],
                    [
                      5.20947532,
                      51.14294613
                    ],
                    [
                      5.20948491,
                      51.14294696
                    ],
                    [
                      5.20949723,
                      51.14288916
                    ],
                    [
                      5.20950882,
                      51.14283467
                    ],
                    [
                      5.20951534,
                      51.14280391
                    ],
                    [
                      5.20963877,
                      51.14282514
                    ],
                    [
                      5.20983592,
                      51.14286194
                    ],
                    [
                      5.20988059,
                      51.14281924
                    ],
                    [
                      5.20996491,
                      51.14282749
                    ],
                    [
                      5.20997291,
                      51.14282947
                    ],
                    [
                      5.21018256,
                      51.14288148
                    ],
                    [
                      5.21028229,
                      51.14290622
                    ],
                    [
                      5.21030483,
                      51.14291181
                    ],
                    [
                      5.21026431,
                      51.14319274
                    ],
                    [
                      5.21026233,
                      51.1432431
                    ],
                    [
                      5.21026127,
                      51.14327016
                    ]
                  ]
                ]
              }
            },
            {
              "id": "52",
              "type": "Feature",
              "properties": {
                "ALVID": 1117249232,
                "GEWASGROEP": "Grasland",
                "HFDTLT": "60",
                "LBLHFDTLT": "Grasland",
                "LBLPM": " ",
                "OIDN": 820114,
                "PM": " ",
                "UIDN": 2674029,
                "index": 9088
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      5.17540782,
                      51.2721762
                    ],
                    [
                      5.17541833,
                      51.27226422
                    ],
                    [
                      5.17332007,
                      51.27209092
                    ],
                    [
                      5.17331899,
                      51.27206998
                    ],
                    [
                      5.17331584,
                      51.27200861
                    ],
                    [
                      5.17540782,
                      51.2721762
                    ]
                  ]
                ]
              }
            },
            {
              "id": "53",
              "type": "Feature",
              "properties": {
                "ALVID": 910034495,
                "GEWASGROEP": "Grasland",
                "HFDTLT": "60",
                "LBLHFDTLT": "Grasland",
                "LBLPM": " ",
                "OIDN": 596661,
                "PM": " ",
                "UIDN": 2674342,
                "index": 9111
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      5.21184352,
                      51.16855893
                    ],
                    [
                      5.21189095,
                      51.16861253
                    ],
                    [
                      5.21162038,
                      51.16887065
                    ],
                    [
                      5.21141722,
                      51.16910133
                    ],
                    [
                      5.21117999,
                      51.16902886
                    ],
                    [
                      5.21103991,
                      51.16899166
                    ],
                    [
                      5.21143081,
                      51.16848752
                    ],
                    [
                      5.21155978,
                      51.16848455
                    ],
                    [
                      5.21184352,
                      51.16855893
                    ]
                  ]
                ]
              }
            },
            {
              "id": "54",
              "type": "Feature",
              "properties": {
                "ALVID": 1059103792,
                "GEWASGROEP": "Grasland",
                "HFDTLT": "60",
                "LBLHFDTLT": "Grasland",
                "LBLPM": " ",
                "OIDN": 1095607,
                "PM": " ",
                "UIDN": 2677680,
                "index": 9361
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      5.17845507,
                      51.25286431
                    ],
                    [
                      5.17839697,
                      51.25286762
                    ],
                    [
                      5.17833873,
                      51.25287095
                    ],
                    [
                      5.17832932,
                      51.25287232
                    ],
                    [
                      5.17832286,
                      51.25287303
                    ],
                    [
                      5.17822442,
                      51.2523855
                    ],
                    [
                      5.17822234,
                      51.25237549
                    ],
                    [
                      5.17822159,
                      51.25237017
                    ],
                    [
                      5.17821204,
                      51.25236475
                    ],
                    [
                      5.17819063,
                      51.25236113
                    ],
                    [
                      5.17818726,
                      51.25235638
                    ],
                    [
                      5.17817938,
                      51.25229855
                    ],
                    [
                      5.17817086,
                      51.25223713
                    ],
                    [
                      5.17814432,
                      51.25211092
                    ],
                    [
                      5.17812106,
                      51.25200097
                    ],
                    [
                      5.17812592,
                      51.25198413
                    ],
                    [
                      5.1781297,
                      51.25197062
                    ],
                    [
                      5.17813663,
                      51.25196563
                    ],
                    [
                      5.17814102,
                      51.25196254
                    ],
                    [
                      5.17849723,
                      51.25193646
                    ],
                    [
                      5.17911357,
                      51.25189511
                    ],
                    [
                      5.17948703,
                      51.25187269
                    ],
                    [
                      5.17951076,
                      51.25187855
                    ],
                    [
                      5.17950539,
                      51.25188272
                    ],
                    [
                      5.17950487,
                      51.25189
                    ],
                    [
                      5.17951615,
                      51.25194143
                    ],
                    [
                      5.17955573,
                      51.25211635
                    ],
                    [
                      5.17964872,
                      51.25270197
                    ],
                    [
                      5.17964833,
                      51.25272093
                    ],
                    [
                      5.17964825,
                      51.25272471
                    ],
                    [
                      5.17965439,
                      51.2527315
                    ],
                    [
                      5.17967247,
                      51.25273353
                    ],
                    [
                      5.17968871,
                      51.25273248
                    ],
                    [
                      5.17969523,
                      51.25272745
                    ],
                    [
                      5.17970166,
                      51.25277263
                    ],
                    [
                      5.17970192,
                      51.25279616
                    ],
                    [
                      5.17964637,
                      51.2528058
                    ],
                    [
                      5.17964129,
                      51.25280161
                    ],
                    [
                      5.17962923,
                      51.25280008
                    ],
                    [
                      5.17959573,
                      51.25280104
                    ],
                    [
                      5.17956738,
                      51.25280185
                    ],
                    [
                      5.17930896,
                      51.25281766
                    ],
                    [
                      5.17901306,
                      51.25283576
                    ],
                    [
                      5.17900564,
                      51.25283787
                    ],
                    [
                      5.17900037,
                      51.25283936
                    ],
                    [
                      5.17899758,
                      51.25284351
                    ],
                    [
                      5.17890855,
                      51.25284745
                    ],
                    [
                      5.17890635,
                      51.25284431
                    ],
                    [
                      5.17890098,
                      51.25284186
                    ],
                    [
                      5.1788961,
                      51.25283962
                    ],
                    [
                      5.17883518,
                      51.25283707
                    ],
                    [
                      5.17845507,
                      51.25286431
                    ]
                  ]
                ]
              }
            },
            {
              "id": "55",
              "type": "Feature",
              "properties": {
                "ALVID": 910337724,
                "GEWASGROEP": "Grasland",
                "HFDTLT": "60",
                "LBLHFDTLT": "Grasland",
                "LBLPM": " ",
                "OIDN": 603755,
                "PM": " ",
                "UIDN": 2678670,
                "index": 9425
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      5.17567347,
                      51.18779196
                    ],
                    [
                      5.17507149,
                      51.18794466
                    ],
                    [
                      5.1746647,
                      51.18715552
                    ],
                    [
                      5.17470061,
                      51.18714525
                    ],
                    [
                      5.17478746,
                      51.18712042
                    ],
                    [
                      5.17492215,
                      51.18710098
                    ],
                    [
                      5.17506206,
                      51.18710173
                    ],
                    [
                      5.17522756,
                      51.18711067
                    ],
                    [
                      5.17541598,
                      51.18713257
                    ],
                    [
                      5.17555696,
                      51.1874936
                    ],
                    [
                      5.17567347,
                      51.18779196
                    ]
                  ]
                ]
              }
            },
            {
              "id": "56",
              "type": "Feature",
              "properties": {
                "ALVID": 912109083,
                "GEWASGROEP": "Grasland",
                "HFDTLT": "60",
                "LBLHFDTLT": "Grasland",
                "LBLPM": " ",
                "OIDN": 1192127,
                "PM": " ",
                "UIDN": 2679701,
                "index": 9492
              },
              "geometry": {
                "type": "Polygon",
                "coordinates": [
                  [
                    [
                      5.18520809,
                      51.18343116
                    ],
                    [
                      5.18517187,
                      51.18343743
                    ],
                    [
                      5.18453052,
                      51.18340384
                    ],
                    [
                      5.18450758,
                      51.18339205
                    ],
                    [
                      5.18495813,
                      51.18188183
                    ],
                    [
                      5.1850986,
                      51.18188283
                    ],
                    [
                      5.1853524,
                      51.18188665
                    ],
                    [
                      5.18538187,
                      51.1818871
                    ],
                    [
                      5.18543822,
                      51.18188794
                    ],
                    [
                      5.18588331,
                      51.18189664
                    ],
                    [
                      5.18588998,
                      51.18189668
                    ],
                    [
                      5.18586816,
                      51.18342309
                    ],
                    [
                      5.18541635,
                      51.18342397
                    ],
                    [
                      5.18520809,
                      51.18343116
                    ]
                  ]
                ]
              }
            }
          ]
        }
      },
      "namespace": "vito"
    },
    "saveresult1": {
      "process_id": "save_result",
      "arguments": {
        "data": {
          "from_node": "AnomalyDetection1"
        },
        "format": "json",
        "options": {}
      },
      "result": true
    }
  }
}

nextlad_usecase.ipynb.txt

@jdries
Copy link
Contributor

jdries commented Jan 25, 2023

Looks like something related to vector datacubes. Providing a feature collection as geometry is something that should work?

@bossie
Copy link
Collaborator Author

bossie commented Feb 2, 2023

Job j-d725d63eafc34fac9db80f88688c3706 (dev) with a GeometryCollection instead of a FeatureCollection fails with the same error:

{
  "process_graph": {
    "AnomalyDetection1": {
      "process_id": "Anomaly_Detection",
      "arguments": {
        "date": [
          "2020-03-06",
          "2020-06-30"
        ],
        "polygon": {
          "type": "GeometryCollection",
          "geometries": [
            {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    5.29417821,
                    51.16171798
                  ],
                  [
                    5.29415133,
                    51.16173122
                  ],
                  [
                    5.2935942,
                    51.16200572
                  ],
                  [
                    5.29351241,
                    51.16195033
                  ],
                  [
                    5.29349958,
                    51.16194164
                  ],
                  [
                    5.29318106,
                    51.16172598
                  ],
                  [
                    5.29351095,
                    51.16158002
                  ],
                  [
                    5.29356126,
                    51.16155831
                  ],
                  [
                    5.29383743,
                    51.16143914
                  ],
                  [
                    5.29417821,
                    51.16171798
                  ]
                ]
              ]
            },
            {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    5.21026127,
                    51.14327016
                  ],
                  [
                    5.21019195,
                    51.1438901
                  ],
                  [
                    5.2101723,
                    51.14388377
                  ],
                  [
                    5.21012479,
                    51.14386442
                  ],
                  [
                    5.21009989,
                    51.14385427
                  ],
                  [
                    5.21008966,
                    51.14384948
                  ],
                  [
                    5.21006885,
                    51.14383994
                  ],
                  [
                    5.21006058,
                    51.14382983
                  ],
                  [
                    5.21001412,
                    51.14382307
                  ],
                  [
                    5.20998341,
                    51.14381419
                  ],
                  [
                    5.20969485,
                    51.14374092
                  ],
                  [
                    5.20968437,
                    51.14373821
                  ],
                  [
                    5.20960665,
                    51.14371539
                  ],
                  [
                    5.20959429,
                    51.1437118
                  ],
                  [
                    5.20938904,
                    51.1436462
                  ],
                  [
                    5.20920185,
                    51.14358344
                  ],
                  [
                    5.20918966,
                    51.14358092
                  ],
                  [
                    5.20918421,
                    51.14357979
                  ],
                  [
                    5.20917368,
                    51.14357761
                  ],
                  [
                    5.20917453,
                    51.14357421
                  ],
                  [
                    5.20931952,
                    51.14295192
                  ],
                  [
                    5.2093303,
                    51.14295304
                  ],
                  [
                    5.20946267,
                    51.14296573
                  ],
                  [
                    5.20946893,
                    51.14294556
                  ],
                  [
                    5.20947532,
                    51.14294613
                  ],
                  [
                    5.20948491,
                    51.14294696
                  ],
                  [
                    5.20949723,
                    51.14288916
                  ],
                  [
                    5.20950882,
                    51.14283467
                  ],
                  [
                    5.20951534,
                    51.14280391
                  ],
                  [
                    5.20963877,
                    51.14282514
                  ],
                  [
                    5.20983592,
                    51.14286194
                  ],
                  [
                    5.20988059,
                    51.14281924
                  ],
                  [
                    5.20996491,
                    51.14282749
                  ],
                  [
                    5.20997291,
                    51.14282947
                  ],
                  [
                    5.21018256,
                    51.14288148
                  ],
                  [
                    5.21028229,
                    51.14290622
                  ],
                  [
                    5.21030483,
                    51.14291181
                  ],
                  [
                    5.21026431,
                    51.14319274
                  ],
                  [
                    5.21026233,
                    51.1432431
                  ],
                  [
                    5.21026127,
                    51.14327016
                  ]
                ]
              ]
            },
            {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    5.17540782,
                    51.2721762
                  ],
                  [
                    5.17541833,
                    51.27226422
                  ],
                  [
                    5.17332007,
                    51.27209092
                  ],
                  [
                    5.17331899,
                    51.27206998
                  ],
                  [
                    5.17331584,
                    51.27200861
                  ],
                  [
                    5.17540782,
                    51.2721762
                  ]
                ]
              ]
            },
            {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    5.21184352,
                    51.16855893
                  ],
                  [
                    5.21189095,
                    51.16861253
                  ],
                  [
                    5.21162038,
                    51.16887065
                  ],
                  [
                    5.21141722,
                    51.16910133
                  ],
                  [
                    5.21117999,
                    51.16902886
                  ],
                  [
                    5.21103991,
                    51.16899166
                  ],
                  [
                    5.21143081,
                    51.16848752
                  ],
                  [
                    5.21155978,
                    51.16848455
                  ],
                  [
                    5.21184352,
                    51.16855893
                  ]
                ]
              ]
            },
            {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    5.17845507,
                    51.25286431
                  ],
                  [
                    5.17839697,
                    51.25286762
                  ],
                  [
                    5.17833873,
                    51.25287095
                  ],
                  [
                    5.17832932,
                    51.25287232
                  ],
                  [
                    5.17832286,
                    51.25287303
                  ],
                  [
                    5.17822442,
                    51.2523855
                  ],
                  [
                    5.17822234,
                    51.25237549
                  ],
                  [
                    5.17822159,
                    51.25237017
                  ],
                  [
                    5.17821204,
                    51.25236475
                  ],
                  [
                    5.17819063,
                    51.25236113
                  ],
                  [
                    5.17818726,
                    51.25235638
                  ],
                  [
                    5.17817938,
                    51.25229855
                  ],
                  [
                    5.17817086,
                    51.25223713
                  ],
                  [
                    5.17814432,
                    51.25211092
                  ],
                  [
                    5.17812106,
                    51.25200097
                  ],
                  [
                    5.17812592,
                    51.25198413
                  ],
                  [
                    5.1781297,
                    51.25197062
                  ],
                  [
                    5.17813663,
                    51.25196563
                  ],
                  [
                    5.17814102,
                    51.25196254
                  ],
                  [
                    5.17849723,
                    51.25193646
                  ],
                  [
                    5.17911357,
                    51.25189511
                  ],
                  [
                    5.17948703,
                    51.25187269
                  ],
                  [
                    5.17951076,
                    51.25187855
                  ],
                  [
                    5.17950539,
                    51.25188272
                  ],
                  [
                    5.17950487,
                    51.25189
                  ],
                  [
                    5.17951615,
                    51.25194143
                  ],
                  [
                    5.17955573,
                    51.25211635
                  ],
                  [
                    5.17964872,
                    51.25270197
                  ],
                  [
                    5.17964833,
                    51.25272093
                  ],
                  [
                    5.17964825,
                    51.25272471
                  ],
                  [
                    5.17965439,
                    51.2527315
                  ],
                  [
                    5.17967247,
                    51.25273353
                  ],
                  [
                    5.17968871,
                    51.25273248
                  ],
                  [
                    5.17969523,
                    51.25272745
                  ],
                  [
                    5.17970166,
                    51.25277263
                  ],
                  [
                    5.17970192,
                    51.25279616
                  ],
                  [
                    5.17964637,
                    51.2528058
                  ],
                  [
                    5.17964129,
                    51.25280161
                  ],
                  [
                    5.17962923,
                    51.25280008
                  ],
                  [
                    5.17959573,
                    51.25280104
                  ],
                  [
                    5.17956738,
                    51.25280185
                  ],
                  [
                    5.17930896,
                    51.25281766
                  ],
                  [
                    5.17901306,
                    51.25283576
                  ],
                  [
                    5.17900564,
                    51.25283787
                  ],
                  [
                    5.17900037,
                    51.25283936
                  ],
                  [
                    5.17899758,
                    51.25284351
                  ],
                  [
                    5.17890855,
                    51.25284745
                  ],
                  [
                    5.17890635,
                    51.25284431
                  ],
                  [
                    5.17890098,
                    51.25284186
                  ],
                  [
                    5.1788961,
                    51.25283962
                  ],
                  [
                    5.17883518,
                    51.25283707
                  ],
                  [
                    5.17845507,
                    51.25286431
                  ]
                ]
              ]
            },
            {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    5.17567347,
                    51.18779196
                  ],
                  [
                    5.17507149,
                    51.18794466
                  ],
                  [
                    5.1746647,
                    51.18715552
                  ],
                  [
                    5.17470061,
                    51.18714525
                  ],
                  [
                    5.17478746,
                    51.18712042
                  ],
                  [
                    5.17492215,
                    51.18710098
                  ],
                  [
                    5.17506206,
                    51.18710173
                  ],
                  [
                    5.17522756,
                    51.18711067
                  ],
                  [
                    5.17541598,
                    51.18713257
                  ],
                  [
                    5.17555696,
                    51.1874936
                  ],
                  [
                    5.17567347,
                    51.18779196
                  ]
                ]
              ]
            },
            {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    5.18520809,
                    51.18343116
                  ],
                  [
                    5.18517187,
                    51.18343743
                  ],
                  [
                    5.18453052,
                    51.18340384
                  ],
                  [
                    5.18450758,
                    51.18339205
                  ],
                  [
                    5.18495813,
                    51.18188183
                  ],
                  [
                    5.1850986,
                    51.18188283
                  ],
                  [
                    5.1853524,
                    51.18188665
                  ],
                  [
                    5.18538187,
                    51.1818871
                  ],
                  [
                    5.18543822,
                    51.18188794
                  ],
                  [
                    5.18588331,
                    51.18189664
                  ],
                  [
                    5.18588998,
                    51.18189668
                  ],
                  [
                    5.18586816,
                    51.18342309
                  ],
                  [
                    5.18541635,
                    51.18342397
                  ],
                  [
                    5.18520809,
                    51.18343116
                  ]
                ]
              ]
            }
          ]
        }
      },
      "namespace": "vito"
    },
    "saveresult1": {
      "process_id": "save_result",
      "arguments": {
        "data": {
          "from_node": "AnomalyDetection1"
        },
        "format": "json",
        "options": {}
      },
      "result": true
    }
  }
}

@bossie
Copy link
Collaborator Author

bossie commented Feb 3, 2023

anomaly_detection will try to apply a fixed negative buffer of -10 meters to the input polygons but one of them (feature "52") is too small so there is nothing left. This will make things go wrong further on.

It's currently unclear what the result of this operation should be so until then it was decided to just return a more descriptive error so the user can adapt his input geometries.

This process graph will trigger the original error:

{
  "type": "FeatureCollection",
  "features": [
    {
      "id": "52",
      "type": "Feature",
      "properties": {
        "ALVID": 1117249232,
        "GEWASGROEP": "Grasland",
        "HFDTLT": "60",
        "LBLHFDTLT": "Grasland",
        "LBLPM": " ",
        "OIDN": 820114,
        "PM": " ",
        "UIDN": 2674029,
        "index": 9088
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              5.17540782,
              51.2721762
            ],
            [
              5.17541833,
              51.27226422
            ],
            [
              5.17332007,
              51.27209092
            ],
            [
              5.17331899,
              51.27206998
            ],
            [
              5.17331584,
              51.27200861
            ],
            [
              5.17540782,
              51.2721762
            ]
          ]
        ]
      }
    },
    {
      "id": "53",
      "type": "Feature",
      "properties": {
        "ALVID": 910034495,
        "GEWASGROEP": "Grasland",
        "HFDTLT": "60",
        "LBLHFDTLT": "Grasland",
        "LBLPM": " ",
        "OIDN": 596661,
        "PM": " ",
        "UIDN": 2674342,
        "index": 9111
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              5.21184352,
              51.16855893
            ],
            [
              5.21189095,
              51.16861253
            ],
            [
              5.21162038,
              51.16887065
            ],
            [
              5.21141722,
              51.16910133
            ],
            [
              5.21117999,
              51.16902886
            ],
            [
              5.21103991,
              51.16899166
            ],
            [
              5.21143081,
              51.16848752
            ],
            [
              5.21155978,
              51.16848455
            ],
            [
              5.21184352,
              51.16855893
            ]
          ]
        ]
      }
    }
  ]
}

Note: remove feature "53" so only "52" is left for a different error.

@Pratichhya : in the meanwhile, you might want to remove features that are too small.

@bossie
Copy link
Collaborator Author

bossie commented Feb 3, 2023

Updated openeo-python-driver to fail early with an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants