Skip to content

Chapter 5: Raster-Vector Interaction#7

Merged
asinghvi17 merged 50 commits into
mainfrom
as/05-raster-vector
Sep 20, 2024
Merged

Chapter 5: Raster-Vector Interaction#7
asinghvi17 merged 50 commits into
mainfrom
as/05-raster-vector

Conversation

@asinghvi17
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread .github/workflows/main.yaml
Comment thread chapters/01-spatial-data.qmd
Comment thread chapters/01-spatial-data.qmd Outdated
Comment thread chapters/01-spatial-data.qmd Outdated
```

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
Copy Markdown
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
Copy Markdown
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!

Comment thread chapters/01-spatial-data.qmd Outdated
Comment thread chapters/01-spatial-data.qmd
Comment thread chapters/01-spatial-data.qmd Outdated
Copy link
Copy Markdown
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.

Comment thread chapters/05-raster-vector.qmd
Comment thread chapters/05-raster-vector.qmd Outdated
Comment thread chapters/05-raster-vector.qmd Outdated
Comment thread chapters/05-raster-vector.qmd Outdated
Comment thread chapters/05-raster-vector.qmd Outdated
Comment thread chapters/05-raster-vector.qmd Outdated
Comment thread chapters/05-raster-vector.qmd
Comment thread chapters/05-raster-vector.qmd Outdated
Comment thread chapters/05-raster-vector.qmd Outdated

TODO: gdal_contour (via ArchGDAL??)

It would be good to show how to use the provided GDAL executables though...
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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:))

Comment thread .github/workflows/main.yaml
@asinghvi17 asinghvi17 merged commit 47f865e into main Sep 20, 2024
@asinghvi17 asinghvi17 deleted the as/05-raster-vector branch September 20, 2024 18:28
@Nowosad
Copy link
Copy Markdown
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