Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sf.kde - Error in sub(re, "", x, perl = TRUE) : input string 1 is invalid UTF-8 #63

Open
jcusens opened this issue May 24, 2024 · 0 comments

Comments

@jcusens
Copy link

jcusens commented May 24, 2024

Hi Jeffrey,

I am coming across this issue (Error in sub(re, "", x, perl = TRUE) : input string 1 is invalid UTF-8) with sf.kde. It works fine when I use CRS 28992 as per the example in the help file, but whn I use another CRS, in this case 32633 i get the error. I have not had this earlier this week when I ran the same code. I am not sure if I am missing something completely obvious about the underlying conditokns for the kde estimate, but as I say, I am running code that worked earlier this week. Repro example below:

library(sf)
library(spatialEco)
library(dplyr)

Load meuse data

data(meuse, package = "sp")

Unweighted KDE (spatial locations only) with 40m resolution using CRS 28992

meuse_28992 <- st_as_sf(meuse, coords = c("x", "y"), crs = 28992,
agr = "constant")

pt_kde_28992 <- sf.kde(x = meuse_28992, bw = 1000, standardize = TRUE, res=40)

Unweighted KDE (spatial locations only) with 40m resolution using CRS 32633

meuse_32633 <- st_as_sf(meuse, coords = c("x", "y"), crs = 28992,
agr = "constant") %>%
st_transform(32633)

pt_kde_32633 <- sf.kde(x = meuse_32633, bw = 1000, standardize = TRUE, res=40)

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

No branches or pull requests

1 participant