rspatial / terra

R package for spatial data handling https://rspatial.github.io/terra/reference/terra-package.html
GNU General Public License v3.0
540 stars 89 forks source link

Can't save names in GPX format #1231

Open kadyb opened 1 year ago

kadyb commented 1 year ago

Repost from: https://github.com/r-spatial/sf/issues/2202

library("terra")
gdal(warn = 1)

n = 5
df = data.frame(x = runif(n), y = runif(n))
df = vect(df, geom = c("x", "y"), crs = "epsg:4326")
df$name = rep(paste0("cam", 1:5))
writeVector(df, "test.gpx", filetype = "GPX", options = "")
#> Warning messages:
#>   1: Value 'cam1' of field test.ele parsed incompletely to real 0. (GDAL 1)
vect("test.gpx", layer = "waypoints")$name
#> [1] NA NA NA NA NA
derek-corcoran-barrios commented 3 months ago

Repost from: r-spatial/sf#2202

library("terra")
gdal(warn = 1)

n = 5
df = data.frame(x = runif(n), y = runif(n))
df = vect(df, geom = c("x", "y"), crs = "epsg:4326")
df$name = rep(paste0("cam", 1:5))
writeVector(df, "test.gpx", filetype = "GPX", options = "")
#> Warning messages:
#>   1: Value 'cam1' of field test.ele parsed incompletely to real 0. (GDAL 1)
vect("test.gpx", layer = "waypoints")$name
#> [1] NA NA NA NA NA

I have also been trying to do this, any update on this issue?