-
Notifications
You must be signed in to change notification settings - Fork 0
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
110 crop raster ep #112
110 crop raster ep #112
Conversation
Thank you!Thank you for your pull request 😃 🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}. If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
Rendered Changes🔍 Inspect the changes: https://github.com/esciencecenter-digital-skills/geospatial-python/compare/md-outputs..md-outputs-PR-112 The following changes were observed in the rendered markdown documents:
What does this mean?If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation. ⏱️ Updated at 2024-05-08 09:47:49 +0000 |
Hi @Morrizzzzz, I updated EP8, cropping raster data. Can you review it? Thx! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor issues, for which I made some suggestions. Have a specific look at episodes/08-crop-raster-data.md line 31 and 32. Good job!
episodes/08-crop-raster-data.md
Outdated
raster = rioxarray.open_rasterio(items[1].assets["visual"].href) # Select a true color image | ||
print(raster.shape) | ||
# Load the search results | ||
items= pystac.ItemCollection.from_file("rhodes_sentinel-2.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check that the search.json is replaced in the figshare file and on line 31 and 32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Morrizzzzz, I just updated the data loading part to load from the downloaded files
|
||
```python | ||
raster_clip_fields = raster_clip_box.rio.clip(fields['geometry']) | ||
# Crop the raster with the bounding box | ||
visual_clipbox = visual.rio.clip_box(*assets.total_bounds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should explain that we are using the * here to unpack the four coordinates. A little more explanation is required here. I am not sure if everybody gets this straigh away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Morrizzzzz I agree. I added some descriptions in the text before this code block, see the changes above. Do you think it's good?
Co-authored-by: Maurice de Kleijn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated review comments
|
||
```python | ||
raster_clip_fields = raster_clip_box.rio.clip(fields['geometry']) | ||
# Crop the raster with the bounding box | ||
visual_clipbox = visual.rio.clip_box(*assets.total_bounds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Morrizzzzz I agree. I added some descriptions in the text before this code block, see the changes above. Do you think it's good?
fix #110