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

110 crop raster ep #112

Merged
merged 10 commits into from
May 8, 2024
Merged

110 crop raster ep #112

merged 10 commits into from
May 8, 2024

Conversation

rogerkuou
Copy link
Collaborator

fix #110

@rogerkuou rogerkuou changed the base branch from main to draft_30042024 May 1, 2024 09:24
Copy link

github-actions bot commented May 1, 2024

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:

  • 🎯 correct output
  • 🖼️ correct figures
  • ❓ new warnings
  • ‼️ new errors

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:

 01-intro-raster-data.md                       |  62 ++--
 02-intro-vector-data.md                       |  30 +-
 03-crs.md                                     |  20 +-
 04-geo-landscape.md                           |  24 +-
 07-vector-data-in-python.md                   | 482 ++++++++++++--------------
 08-crop-raster-data.md                        | 268 +++++---------
 fig/E07/greece_administration_areas.png (new) | Bin 0 -> 64055 bytes
 fig/E07/greece_highways.png (new)             | Bin 0 -> 26479 bytes
 fig/E07/rhodes_administration_areas.png (new) | Bin 0 -> 17351 bytes
 fig/E07/rhodes_assets.png (new)               | Bin 0 -> 45400 bytes
 fig/E07/rhodes_builtup_buffer.png (new)       | Bin 0 -> 18396 bytes
 fig/E07/rhodes_highways.png (new)             | Bin 0 -> 80495 bytes
 fig/E07/rhodes_infra_highways.png (new)       | Bin 0 -> 46913 bytes
 fig/E08/dem.png (new)                         | Bin 0 -> 98203 bytes
 fig/E08/dem_matched.png (new)                 | Bin 0 -> 122237 bytes
 fig/E08/visual_clip.png (new)                 | Bin 0 -> 77146 bytes
 fig/E08/visual_clip_box.png (new)             | Bin 0 -> 374262 bytes
 fig/E08/visual_large.png (new)                | Bin 0 -> 197716 bytes
 index.md                                      |  30 +-
 md5sum.txt                                    |  16 +-
 setup.md                                      |  26 +-
 21 files changed, 422 insertions(+), 536 deletions(-)
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

github-actions bot pushed a commit that referenced this pull request May 1, 2024
@rogerkuou rogerkuou requested a review from Morrizzzzz May 1, 2024 09:38
@rogerkuou
Copy link
Collaborator Author

Hi @Morrizzzzz, I updated EP8, cropping raster data. Can you review it? Thx!

github-actions bot pushed a commit that referenced this pull request May 2, 2024
@rogerkuou rogerkuou mentioned this pull request May 2, 2024
Copy link

@Morrizzzzz Morrizzzzz left a 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!

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")

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

Copy link
Collaborator Author

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

episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved
episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved
episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved
episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved

```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)

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.

Copy link
Collaborator Author

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?

episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved
episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved
episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved
episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved
Co-authored-by: Maurice de Kleijn <[email protected]>
github-actions bot pushed a commit that referenced this pull request May 7, 2024
github-actions bot pushed a commit that referenced this pull request May 7, 2024
Copy link
Collaborator Author

@rogerkuou rogerkuou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated review comments

episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved
episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved
episodes/08-crop-raster-data.md Outdated Show resolved Hide resolved

```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)
Copy link
Collaborator Author

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?

github-actions bot pushed a commit that referenced this pull request May 8, 2024
@rogerkuou rogerkuou merged commit 8cfcfb1 into draft_30042024 May 8, 2024
2 checks passed
@Morrizzzzz Morrizzzzz deleted the 110_crop_raster_ep branch June 25, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update crop raster data episode
2 participants