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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

rio stack library function missing #2033

Open
daniel-j-h opened this issue Nov 11, 2020 · 2 comments
Open

rio stack library function missing #2033

daniel-j-h opened this issue Nov 11, 2020 · 2 comments

Comments

@daniel-j-h
Copy link
Contributor

Hey folks 馃憢 I have three single-channel rasters I want to stack, to get a dataset with three channels. The broader context is: I want the raster single-channel numpy arrays aligned and stacked in a single numpy array, where pixels correspond to each other.

And while there exists a rio stack command, I haven't found a corresponding library function to do this from Python.

Ideally rio stack would behave like rio merge but instead of reducing the three input rasters to a single channel output raster, stack would just concatenate the three single channel rasters into a three channel output raster.

In this generalization, stack could also automatically handle different resolutions, shapes, etc. just like merge does already.

Is there a reason

  1. stack does not exist as a library function
  2. the stack cli does not automatically handle different shapes and resolutions like merge does

Can we generalize the merge implementation (maybe provide a method=cat option?) and then have a stack library function and cli wrapper around that? Thoughts? 馃

Expected behavior and actual behavior.

  1. stack library function exists
  2. stack (library function and cli tool) handle different resolutions and shapes, just like merge does

Steps to reproduce the problem.

  1. Look through rasterio docs for a stack function
  2. Look through rasterio source code for a stack function
  3. Stare outside the window and contemplate buying a boat

Operating system

ubuntu 20.04 docker container

Rasterio version and provenance

1.1.8

@sgillies
Copy link
Member

@daniel-j-h you're right, there's no API module about stacking. But there is a place reserved for it: #1322. And a conceptual framework: #1300.

@sgillies
Copy link
Member

For 1.4.0, possibly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants