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

STAC item validation failure when using view extension apply #258

Closed
tyler-c2s opened this issue Feb 9, 2021 · 0 comments · Fixed by #259
Closed

STAC item validation failure when using view extension apply #258

tyler-c2s opened this issue Feb 9, 2021 · 0 comments · Fixed by #259

Comments

@tyler-c2s
Copy link
Contributor

Currently getting validation errors when using the view extensions .apply() method.

Example:

view_dict = {'off_nadir': 0, 'sun_azimuth': 133.076479108908, 'sun_elevation': 33.4042972979731}
item.ext.view.apply(**view_dict)
item.validate()

results in:

ValidationError: None is not of type 'number'

Failed validating 'type' in schema['allOf'][1]['properties']['properties']['properties']['view:incidence_angle']:
    {'maximum': 90,
     'minimum': 0,
     'title': 'Center incidence angle',
     'type': 'number'}

On instance['properties']['view:incidence_angle']:
    None

this is not the case when directly adding each property:

"""
view_dict = {'off_nadir': 0, 'sun_azimuth': 133.076479108908, 'sun_elevation': 33.4042972979731}
item.ext.view.off_nadir = view_dict["off_nadir"]
item.ext.view.sun_azimuth = view_dict["sun_azimuth"]
item.ext.view.sun_elevation = view_dict["sun_elevation"]
item.validate()

the issue appears to be that when using the apply function, any non-included parameters are set to None, causing issues in validation

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

Successfully merging a pull request may close this issue.

1 participant