Skip to content

Conversation

@evetion
Copy link
Member

@evetion evetion commented Dec 31, 2024

[0.7.0]

Added

  • Improved documentation by using VitePress and showcasing all methods on a DEM.
  • Package extensions on GeoArrays and Rasters that automatically set the cellsize for all methdos using that kwarg, taking into account geographical data (lat/lon).
  • Added hydrology operators: filldepressions, flowaccumulation, with different algorithms (D8, DInf, FD8) available via the method kwarg.
  • Added multiscale options to relative terrain operations using a window kwarg for a Stencil from Stencils.jl package.
  • Added BPI as a relative terrain operation.
  • Overhauled curvature methods by introducing plan_curvature, profile_curvature and contour_curvature, while deprecating curvature for laplacian.
  • Added direction kwarg to slope and curvature methods.
  • Added radius kwarg to curvature methods.
  • Added this CHANGELOG.md

Changed

  • Using Stencils instead of LocalFilters.
  • Refactored spread to choose from multiple algorithms with the method kwarg.

Fixed

  • Relaxed Array input to AbstractArray for opening

@evetion
Copy link
Member Author

evetion commented Feb 28, 2025

@alex-s-gardner For which curvatures (plan, profile, contour) do you want to use the direction argument? Do you have something working currently?

Comment on lines +30 to +36
function _crstrait(dem::Raster)
crs = Rasters.crs(dem)
acrs = ArchGDAL.importCRS(crs)
Bool(ArchGDAL.GDAL.osrisgeographic(acrs.ptr)) && return Rasters.GI.GeographicTrait()
Bool(ArchGDAL.GDAL.osrisprojected(acrs.ptr)) && return Rasters.GI.ProjectedTrait()
return Rasters.GI.UnknownTrait()
end
Copy link
Member Author

Choose a reason for hiding this comment

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

@rafaqz @tiemvanderdeure Ideally we implement crstrait on Rasters itself. And there is a cellarea method, but ideally we have the underlying cellsize (resolution?) as well. If we get a unit with that, even better.

@alex-s-gardner
Copy link
Contributor

@alex-s-gardner For which curvatures (plan, profile, contour) do you want to use the direction argument? Do you have something working currently?

I missed your earlier ping: I currently use directional profile curvature... instead of calculation curvature along maximum slope I calculate it along a direction.

@evetion evetion marked this pull request as ready for review March 21, 2025 14:39
@evetion
Copy link
Member Author

evetion commented Mar 21, 2025

@alex-s-gardner For which curvatures (plan, profile, contour) do you want to use the direction argument? Do you have something working currently?

I missed your earlier ping: I currently use directional profile curvature... instead of calculation curvature along maximum slope I calculate it along a direction.

Do you have a code example/snippet? My code is here: https://github.com/Deltares/Geomorphometry.jl/pull/41/files#diff-5e200c4ade1e6d95f1c218e8fa25406ee2b424c81f5dff53ecc59c1c641adc4fR295-R334, can be a bit hard to follow. A direction of 0 degrees is north. Might be best to just plot and compare, and see whether they're similar.

@evetion evetion merged commit 68de1ee into main Mar 21, 2025
8 of 11 checks passed
@alex-s-gardner
Copy link
Contributor

Do you have a code example/snippet?

So in my work I was only calculating curvature along the x and y directions only so my stencil looked like this:

## planer curvature
    # https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/how-curvature-works.htm
    ddx(v) = ((v[2] + v[8]) / 2 - v[5])  / lx^2
    ddy(v) = ((v[4] + v[6]) / 2 - v[5])  / ly^2

where v is the stencil extracted from the DEM, lx and ly are the pixel size (looks like I was using planer not profile

@evetion
Copy link
Member Author

evetion commented Mar 21, 2025

That's only the dz/dx and dz/dy calculation (so slope, not curvature?). Docs are now live at https://deltares.github.io/Geomorphometry.jl/dev/usage#curvature

@alex-s-gardner
Copy link
Contributor

It's curvature as it subtracts the central value v[5] and divides by l[x/y] .^2 so its ddz/dx and ddy/dy

It's D and E in the first example found here: https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/how-curvature-works.htm

But not worth spending any time on ... i use it to identify correlated biases in DEMs so I only use it as a relative metric of curvature... not something you should replicate... sorry for the confusion

@alex-s-gardner
Copy link
Contributor

Docs are now live

These docs are so impressive... what a great package!

@evetion
Copy link
Member Author

evetion commented Mar 21, 2025

It's curvature as it subtracts the central value v[5] and divides by l[x/y] .^2 so its ddz/dx and ddy/dy

It's D and E in the first example found here: https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/how-curvature-works.htm

But not worth spending any time on ... i use it to identify correlated biases in DEMs so I only use it as a relative metric of curvature... not something you should replicate... sorry for the confusion

Well, it's already in. It was named curvature, but based on the Minár paper now laplacian, and it takes a direction argument. See https://github.com/Deltares/Geomorphometry.jl/blob/main/src/terrain.jl#L244-L293 (I used the ArcGIS reference as well). The only thing that's different from directly using D and E is the -2 multiplication. I will add it to the examples as well.

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.

3 participants