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

Chapter 5: Raster-Vector Interaction #7

Merged
merged 50 commits into from
Sep 20, 2024
Merged

Conversation

asinghvi17
Copy link
Collaborator

@asinghvi17 asinghvi17 commented Sep 19, 2024

Local successor to #4.

Requires the following PRs:

This PR copies over all data from geocompy and aims to implement ch. 5 of geocompx in Julia. Primarily uses Rasters and GeometryOps for reprojection and resampling.

@asinghvi17 asinghvi17 changed the title [WIP] Chapter 5: Raster-Vector Interaction Chapter 5: Raster-Vector Interaction Sep 20, 2024
Copy link
Collaborator

@evetion evetion left a comment

Choose a reason for hiding this comment

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

Loving it so far, and very quick work! It's a bit hard to review without the pictures, so let's get this merged asap.

My main suggestions would be to introduce the crs on its own (not a part of writing) and introducing some Julia unique features in here.

.github/workflows/main.yaml Show resolved Hide resolved
chapters/01-spatial-data.qmd Show resolved Hide resolved
chapters/01-spatial-data.qmd Outdated Show resolved Hide resolved
chapters/01-spatial-data.qmd Outdated Show resolved Hide resolved
```

The `grain` array represents a categorical raster with values `0`, `1`, `2`, corresponding to categories "clay", "silt", "sand", respectively.
We will create it from a specific arrangement of pixel values, using `reshape`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does Rasters support CategoricalArrays? Might be nice to introduce some Julia concepts of combining everything seamlessly?

Copy link
Collaborator Author

@asinghvi17 asinghvi17 Sep 20, 2024

Choose a reason for hiding this comment

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

It does but I don't know if that will write to file correctly, will try it!

chapters/01-spatial-data.qmd Outdated Show resolved Hide resolved
chapters/01-spatial-data.qmd Outdated Show resolved Hide resolved
chapters/01-spatial-data.qmd Outdated Show resolved Hide resolved
Copy link
Contributor

@alex-s-gardner alex-s-gardner left a comment

Choose a reason for hiding this comment

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

This is absolutely fantastic... can't wait to see this finalized.

Minor comments / suggestions. Hopefully alt least some are helpful.

chapters/05-raster-vector.qmd Show resolved Hide resolved
chapters/05-raster-vector.qmd Outdated Show resolved Hide resolved
chapters/05-raster-vector.qmd Outdated Show resolved Hide resolved
chapters/05-raster-vector.qmd Outdated Show resolved Hide resolved
chapters/05-raster-vector.qmd Outdated Show resolved Hide resolved
chapters/05-raster-vector.qmd Outdated Show resolved Hide resolved
chapters/05-raster-vector.qmd Show resolved Hide resolved
chapters/05-raster-vector.qmd Outdated Show resolved Hide resolved
chapters/05-raster-vector.qmd Outdated Show resolved Hide resolved

TODO: gdal_contour (via ArchGDAL??)

It would be good to show how to use the provided GDAL executables though...
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree... I wonder if a section on file minipulation using GDAL should be added at some point. This could include building a vrt of raster files, merging shapefiles, cropping shapefiles, converting between file formats

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree! There's a chapter in the R book https://r.geocompx.org/gis that would be perfect for that, maybe we even make this a separate chapter.

Copy link
Member

Choose a reason for hiding this comment

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

Another option is to include such examples in i/o chapter (building a vrt, merging files, converting between formats) and raster-vector chapter (cropping).

(Side comment: I would suggest not using shapefiles (the file format) at all, except maybe mentioning it; it is time to stop using this format imo)

Copy link
Contributor

Choose a reason for hiding this comment

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

Shapefile is a horrible format that users need to know how to work with as there is so much legacy data out there... maybe the only example we show is how to convert a shapefile to something useful ;-)

Copy link
Member

Choose a reason for hiding this comment

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

That would be also my suggestion -- guiding readers in right direction (i.e. opposite of the shapefile one:))

@asinghvi17 asinghvi17 merged commit 47f865e into main Sep 20, 2024
1 check passed
@asinghvi17 asinghvi17 deleted the as/05-raster-vector branch September 20, 2024 18:28
@Nowosad
Copy link
Member

Nowosad commented Sep 20, 2024

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.

5 participants