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

Add cog access via python doc #124

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

moradology
Copy link

This PR adds some documentation about accessing data within cogs without loading the whole file. It included rasterio and rio-xarray examples and provides (slightly annoying, hacky) logging of byte-ranges requested to reveal some of the goings-on behind the curtain

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@wildintellect
Copy link
Contributor

wildintellect commented Jan 24, 2025

@smk0033 and @hrodmn might want to review

Sadly ReviewNB didn't want to save my comments (ah because of the force push while I was working), here they are in order but out of context without the section references.

I think Key Benefits should be moved to https://guide.cloudnativegeo.org/cloud-optimized-geotiffs/intro.html

The other existing pages should also be referenced where applicable.

In our other examples we provide a conda env with the packages https://guide.cloudnativegeo.org/cloud-optimized-geotiffs/cogs-examples.html

I think we need a TLDR code block first, this with the shortest example possible, and a read on if you want to know more. We want to get across that it's actually very simple to use.

"we can a free," incomplete statement

Should we link to a page about Sentinel-2, either official home page or Wikipedia, what about citing the OpenData page on AWS too?

I think it's better to say we're going to align our request with the internal tile structure to prove how requests are partial and minimized. In normal usage a user would not usually think about this at all.

Consider reordering the title of this section to de-emphasize visualization since the next section is actually about data visualization. "Internal Tile Grid of the COG" seems ok on it's own, or maybe "Understanding the ..."

maybe use rio info or gdalinfo, or rasterio properties to show the overview levels and their resolutions?

Copy link

review-notebook-app bot commented Jan 24, 2025

View / edit / reply to this conversation on ReviewNB

hrodmn commented on 2025-01-24T17:01:37Z
----------------------------------------------------------------

Following on @wildintellect's suggestion for some quick code examples at the top I think it would be valuable to include a quick example for how to determine if a file is a COG or not and also an example of how to write a COG since it is really important for users who are creating data to produce COGs, too.


wildintellect commented on 2025-01-24T17:25:25Z
----------------------------------------------------------------

@hrodmn that is already covered in a different doc https://guide.cloudnativegeo.org/cloud-optimized-geotiffs/writing-cogs-in-python.html and https://guide.cloudnativegeo.org/cloud-optimized-geotiffs/cogs-examples.html#is-it-a-valid-cog

We should be linking to those.

Copy link

review-notebook-app bot commented Jan 24, 2025

View / edit / reply to this conversation on ReviewNB

hrodmn commented on 2025-01-24T17:01:38Z
----------------------------------------------------------------

  • "we can a free" -> "we can use a free"
  • it would be great to provide an example of how to find out if a .tif file is a COG (using rasterio or rio_cogeo.validate)

@hrodmn
Copy link
Collaborator

hrodmn commented Jan 24, 2025

This is a great, thanks @moradology! I think the only things I would add are 1) how to find out if a .tif file is a COG and 2) how to write a COG with rasterio (or rioxarray or both) since it is 2025 and everyone who writes .tif files should be writing COGs!

Copy link
Contributor

@hrodmn that is already covered in a different doc https://guide.cloudnativegeo.org/cloud-optimized-geotiffs/writing-cogs-in-python.html and https://guide.cloudnativegeo.org/cloud-optimized-geotiffs/cogs-examples.html#is-it-a-valid-cog

We should be linking to those.


View entire conversation on ReviewNB

@moradology moradology force-pushed the feature/python-cog-access branch from 1913d46 to 41096cb Compare January 27, 2025 21:41
@moradology
Copy link
Author

Updates in place with a TLDR cell up front, environment setup mentioned, and an extended discussion of overviews
image

Copy link

review-notebook-app bot commented Jan 29, 2025

View / edit / reply to this conversation on ReviewNB

smk0033 commented on 2025-01-29T21:26:51Z
----------------------------------------------------------------

The "guide on writing COGs" and "guide on COG validation" hyperlinks lead to 404 errors (not sure if you can just link back to the .ipynb versions, or if the current paths will work when the notebook is published and in the docs? If the latter is true, then you can ignore this comment!)


@smk0033
Copy link
Collaborator

smk0033 commented Jan 29, 2025

I really like the detail and explanations in this notebook! I had one minor comment about a couple broken hyperlinks, but those may work when the notebook is published and in the docs

@wildintellect
Copy link
Contributor

We can check the links in a preview when the PR is opened from staging to main

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 this pull request may close these issues.

4 participants