Fix mosaic quad info/contribution #149
Merged
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.
Mosaic quad information retrieval (i.e.
mosaics quad-info
andmosaics contribution
) is currently broken. For example:ClientV1.get_quad_by_id
currently constructs the url it requests by naively appending paths to the mosaic's_links.self
. However, mosaic url returned by the api has the user's api key included as a parameter. This results in a url with the quad's path as part of theapi_key
parameter, resulting in the 403 response.E.g.
planet mosaics quad-info basemap_medres_weekly_permian_20180917_20180923 446-1201
actually requests
https://api.planet.com/basemaps/v1/mosaics/1e9ae02c-64b7-428d-bbcd-7df3f9a94f14?api_key=FOOBAR/quads/446-1201
This PR fixes the issue by constructing the quad url based on the mosaic's id and the quad endpoint.