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

Rewrite the geometry_window to obtain the most similar window to the predefined shapes #2915

Open
lauraset opened this issue Sep 5, 2023 · 3 comments

Comments

@lauraset
Copy link

lauraset commented Sep 5, 2023

Provide a solution to generate the most similar window

When I use the default setting in the function rasterio.features.geometry_window, I get the outermost window.
However, this setting may generate a bigger extent than the predefined shapes.

Possible solution

In the function rasterio.features.geometry_window, line 464-465:
row_start, row_stop = int(round(min(rows))), int(round(max(rows))) # replace math.floor and math.ceil with round col_start, col_stop = int(round(min(cols))), int(round(max(cols)))

@sgillies
Copy link
Member

sgillies commented Sep 8, 2023

@lauraset can you explain more? Why is the outermost window undesirable? How does this affect your application?

@lauraset
Copy link
Author

lauraset commented Sep 8, 2023 via email

@lauraset
Copy link
Author

lauraset commented Sep 9, 2023

@sgillies, Hi. I show a figure:
image

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

2 participants