GIScience / ohsome-qgis-plugin

ohsome Qgis plugin
MIT License
6 stars 1 forks source link

Handle GeometryCollections #51

Open SlowMo24 opened 2 years ago

SlowMo24 commented 2 years ago

This request will return a GeometryCollection:

2022-02-13T22:22:42     INFO    Started task "OHSOME task"
2022-02-13T22:22:42     INFO    url: https://api.ohsome.org/v1/elementsFullHistory/geometry?
             Parameters: {
              "clipGeometry": "false",
              "properties": "tags,metadata",
              "showMetadata": "true",
              "filter": "id:relation/48418",
              "time": "2007-10-08T00:00:01,2022-02-07",
              "bcircles": "id0:8.626937, 49.399239,1000"
             }
2022-02-13T22:23:01     INFO    The request was successful:
             API URL: https://api.ohsome.org/v1
             Endpoint: elementsFullHistory/geometry
             Preferences: {
              "bcircles": "id0:8.626937, 49.399239,1000",
              "clipGeometry": "false",
              "filter": "id:relation/48418",
              "properties": "tags,metadata",
              "showMetadata": "true",
              "time": "2007-10-08T00:00:01,2022-02-07"
             }"

QGis cannot handle GeometryCollections: https://github.com/qgis/QGIS/issues/32747. Therefore these collections need to be exploded before importing them to QGis like ogr2ogr -explodecollections out.geojson ohsome.geojson (though other output formats would be better suited of course).

The plugin seems to try something but instead saves an invalid .geojson where the geometry is completely missing.