21 function to get elevation associated with points - #80
Merged
Robinlovelace merged 4 commits intoJun 22, 2026
Merged
Conversation
…coordinate embedding and elevation columns #21
Robinlovelace
approved these changes
Jun 22, 2026
Robinlovelace
deleted the
21-function-to-get-elevation-associated-with-points
branch
June 22, 2026 19:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Added Support for
POINTGeometries (Closes #21)elevation_add()to gracefully handlesfobjects containingPOINTorMULTIPOINTgeometries.add_z = TRUE), the function embeds the extracted elevation directly into the point's geometry as the Z coordinate (returningPOINT Zfeatures), mirroring the behavior for linestrings.add_column = TRUE/FALSEparameter for points, allowing users to optionally append the elevation as an explicit data frame attribute column. Settingadd_z = FALSEandadd_column = TRUEallows returning a standardXYgeometry with the elevation only in the column.2. Reorganized Scripts & Separated Concerns
R/elevation.Rfile to handle all elevation-related operations (elevation_extract,elevation_add,elevation_get, andsf_mid_ext_lonlat).z_*helper functions fromR/z-functions.RintoR/elevation.Rand deleted the orphaned file.R/slopes.Ris now strictly dedicated to pure slope mathematical estimations.R/slope_get.Ris now strictly dedicated to raster/matrix utility functions.3. Test Suite Refactoring & Coverage
tests/testthat/test-elevation.Rfile and migrated all elevation/Z-coordinate tests over fromtest-slopes.R,test-get.R, andtest-z.R(deleting the latter two).elevation_add()with point geometries, covering all permutations of theadd_zandadd_columnarguments.4. Documentation Updates
elevation_add()to explicitly detail the behavior with points and the newadd_columnandadd_zparameters.@examplesfor point geometries directly in the documentation.elevation_add()also works natively with points.