-
Notifications
You must be signed in to change notification settings - Fork 122
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
Fix spacenet tutorial, allow for single bbox argument to SpatialExtent, and other fixes. #201
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also adds validation to the catalogs at each point so that we can avoid this type of error moving forward. Modifies the construction of the label items to avoid validation errors. Fixes #197
Shapely can produce GeoJSON mappings that use tuples in the coordinate sequences of geometries instead of lists. A direct validation of the dict for GeoJSON will produce errors, since coordinates are expected to be list-based. This commit adds a translation to and from JSON serialization in order to work around this and other issue which may appear if a JSON serialization would pass validation but the STAC dict may not.
lossyrob
force-pushed
the
rde/fix-doc-build
branch
from
October 16, 2020 17:39
f4ba28e
to
954811d
Compare
schwehr
requested changes
Oct 16, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure best to review for pystac. I tried to err side of too many comments, questions, and suggestions.
- Use consistent datetime - Don't use license if not required - Make descriptions different than IDs - Specify why we're setting th href
- use consistent datetime - better docstring - use different ID and description - Get item link explicitly
- Use less decimal places - use simpler parameters. - comment why the trailing , is needed.
schwehr
approved these changes
Oct 22, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a few fixes and enhancements based on solving the issues raised in #197 and #198.
label_classes
property is required. This requirement is dropped in a yet-unreleased version of the schemas, so a note was added to remove after 1.0.0-beta.2's successor is released.Link.get_href()
, which was throwing a bad exception if a relative link had None for it's target href.SpatialExtent
and interval toTemporalExtent
to guard against the common mistake mentioned in Type check SpatialExtent bboxes parameter #198to_dict
call. This can produce geometries that have their coordinates encoded with tuples instead of lists. The GeoJSON schema requires these to be lists, so the validation failed with a very cryptic message (a byproduct of usingoneOf
in JSON schemas - if the object doesn't matchoneOf
the schemas listed for a real validation failure, it instead complains about how it doesn't validate correctly against the first entry). The workaround here is to transform the dicts being passed in for validation to and from JSON serialization - if you JSON serialize a property whose value is a tuple, that will be transformed into a list for the JSON-ification. This solves the issue with shapely'smapping
output, but also will solve for any case where a JSON serialization of an object would actually pass JSON schema validation, but the direct dict encoding may not.ipython
in the dev dependencies.Fixes #197
Fixes #198