qgis-stac-plugin icon indicating copy to clipboard operation
qgis-stac-plugin copied to clipboard

Plugin crashes when "type" field is not present on assets

Open chrsphr opened this issue 2 years ago • 1 comments

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

image

chrsphr avatar Feb 16 '23 15:02 chrsphr

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.

emilyselwood avatar Feb 17 '23 09:02 emilyselwood