You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)))
The text was updated successfully, but these errors were encountered:
when the input raster has a coarse spatial resolution (e.g. 10 m), the shapefile used to mask the raster may have low overlaping rate with the raster on the boundary of the shapefile. If we use the outermost extent, the extent of the masked raster is larger than that of the shapefile. in this case, I think that using 'round' is more suitable than 'ceiling'.
---- Replied Message ----
| From | Sean ***@***.***> |
| Date | 09/09/2023 00:13 |
| To | ***@***.***> |
| Cc | ***@***.***>***@***.***> |
| Subject | Re: [rasterio/rasterio] Rewrite the geometry_window to obtain the most similar window to the predefined shapes (Issue #2915) |
@lauraset can you explain more? Why is the outermost window undesirable? How does this affect your application?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
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
, line464-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)))
The text was updated successfully, but these errors were encountered: