Giter Club home page Giter Club logo

Comments (27)

rsignell-usgs avatar rsignell-usgs commented on May 29, 2024 1

Yes, here's the rather lame way I'm dealing with overviews now: https://nbviewer.jupyter.org/gist/rsignell-usgs/0f96bb9c0ca34a5dd0fc8131a7bbae1c
I was hoping for something better. 😺

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024 1

image

Do you happen to have one with overviews?

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024 1
rds.overviews(1)

[]

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024 1

Perfect, thanks! Mind if I add it to the repo? Also, mind if I add you to the contributor list for testing?

from rioxarray.

vincentsarago avatar vincentsarago commented on May 29, 2024 1

sure, no worry ;-)

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

rioxarray has the rioxarray.open_rasterio() function which uses rasterio.open() under the hood and should be able to open anything handled by rasterio.open(). Do you have an example GOG overlay to try?

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

Nice example. I don't think we have anything better than that at the moment, but it sounds like that would be pretty useful to add.

Currently the open function reads data like so:

out = riods.read(band_key, window=window, masked=self.masked)

I think this will need to be thought through a bit as the current implementation uses windowed reading for lazy loading. When using COG overview, it seems that everything needs to be scaled.

My current thoughts on adding support for this is to add support for decimated reading.

Other ideas?

from rioxarray.

rsignell-usgs avatar rsignell-usgs commented on May 29, 2024

Before I knew about the existance of rioxarray, I raised the issue here:
pydata/xarray#3269
with an idea of at least being able to manually request a specific overview via an additional parameter request.

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

Maybe three kwargs?

  1. overlay_index to select the resampling factor from the overlay index.
  2. resampling_factor to pass in resampling read scale factor https://rasterio.readthedocs.io/en/latest/topics/resampling.html
  3. resampling_method

Also found this useful for reference:
https://automating-gis-processes.github.io/CSC/notebooks/L5/read-cogs.html

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

rasterio/rasterio#1504

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

https://gist.github.com/snowman2/9c15df64bd290d1ffd928e0b66855b07
You can try it out with code in #48. It does not allow you to switch between overviews at the moment (it just seems to load in the highest resolution). So, needs more research. But, the first overview read works.

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

Issue addressed. It was related to: rasterio/rasterio#1504

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

@rsignell-usgs any issues using the URL from your example for an example in rioxarray? Is it a temporary file or a longer term file?

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

@vincentsarago do you happen to have a small test-sized COG tif file that could be used for testing?

from rioxarray.

vincentsarago avatar vincentsarago commented on May 29, 2024

@snowman2 https://github.com/cogeotiff/rio-cogeo/blob/master/tests/fixtures/image_rgb.tif ?

from rioxarray.

vincentsarago avatar vincentsarago commented on May 29, 2024

πŸ€¦β€β™‚

from rioxarray.

vincentsarago avatar vincentsarago commented on May 29, 2024

Sorry about that, this one should be better https://www.dropbox.com/s/g6etn6o9x3bed62/cog.tif?dl=0

from rioxarray.

rsignell-usgs avatar rsignell-usgs commented on May 29, 2024

@snowman2 I intend to leave the Southern California DEM COG there for a few months or so, but after that, it will hopefully move back to sciencebase.gov, so probably not the best to use for long-term examples.

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

@snowman2 I intend to leave the Southern California DEM COG there for a few months or so, but after that, it will hopefully move back to sciencebase.gov, so probably not the best to use for long-term examples.

@rsignell-usgs That is good to know. Thanks for letting me know. Are you aware of any COG files that are accessible via URL and are more long term?

from rioxarray.

vincentsarago avatar vincentsarago commented on May 29, 2024

@snowman2 on https://openaerialmap.org you should find what you need

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

@snowman2 on https://openaerialmap.org you should find what you need

Thanks for the link. I took a quick look and it seems like it provides tiled endpoints, but I couldn't find an endpoint to a COG. I am probably missing something, so please point it out if I am.

from rioxarray.

vincentsarago avatar vincentsarago commented on May 29, 2024

Capture d’écran, le 2019-09-20 Γ  09 57 56
@snowman2 you can find the link on the little arrow down

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

Nice, thanks for that πŸ‘

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

Updated: https://corteva.github.io/rioxarray/html/examples/COG.html

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

@rsignell-usgs, this was a good idea and you provided useful examples to help implement this feature. Mind if I add you to the contributors list for ideas?

from rioxarray.

rsignell-usgs avatar rsignell-usgs commented on May 29, 2024

@snowman2 , sure that would be great! BTW, here's my new streamlined hillshade notebook using the overview enhancement of #48 and the CRS help supplied in #49.

from rioxarray.

snowman2 avatar snowman2 commented on May 29, 2024

Nice! The notebook looks much simpler to use.

Sounds good, I will add you in a bit.

from rioxarray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.