qgis-stac-plugin
qgis-stac-plugin copied to clipboard
Plugin crashes when "type" field is not present on assets
Plugin crashes after pressing 'View assets' on an item, where the item has assets which have the 'type' field missing. The type field is not strictly required for assets, so we should be able to handle this
https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#asset-object
Had a short look to see if this could be hunted down easily...
While making the field optional in the AssetWidget is reasonably easy, with out knowing the type it will never be able to actually load it. It uses the type as a mapping against the AssetLayerType enum to figure out what it is loading. Given the type is not required in the spec this likely needs an attempt to guess at the type from the asset file extension as well.
This seems like a bigger change and should be discussed first.