From 59d8e110f0a1f7d861fefa3c4d43065ccc7535d1 Mon Sep 17 00:00:00 2001 From: robinlovelace Date: Fri, 3 Nov 2023 10:33:11 +0000 Subject: [PATCH] Add warning message, close #522 --- R/linefuns.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/R/linefuns.R b/R/linefuns.R index 1a9ecd01..57d1a3f3 100644 --- a/R/linefuns.R +++ b/R/linefuns.R @@ -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))