Skip to content

Commit

Permalink
Add warning message, close #522
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Nov 3, 2023
1 parent f72e6ae commit 59d8e11
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/linefuns.R
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,13 @@ use_rsgeo <- function(shp) {
line_segment_rsgeo <- function(l, n_segments) {

crs <- sf::st_crs(l)
# Test to see if the CRS is latlon or not and provide warning if so
if (sf::st_is_longlat(l)) {
warning(
"The CRS of the input object is latlon.\n",
"This may cause problems with the rsgeo implementation of line_segment()."
)
}

# extract geometry and convert to rsgeo
geo <- rsgeo::as_rsgeo(sf::st_geometry(l))
Expand Down

0 comments on commit 59d8e11

Please sign in to comment.