Closed dcooley closed 4 years ago
The final column names are incorrect (using geometry as the column)
geometry
df <- data.frame( id = c(1,1,1,1,2,2,2,2) , x = rnorm(8) , y = rnorm(8) ) sf <- sfheaders::sf_multipoint(df, "x", "y", multipoint_id = "id") sf <- cbind( sf, sf ) sf <- setNames( sf, c("id1","geometry","id2","geometry.1")) origin <- c("geometry") destination <- c("geometry.1") attr( sf, "sf_column" ) <- origin sf <- sfheaders::sf_cast( sf, "POINT" )
but it works when the geometry is not geometry
df <- data.frame( id = c(1,1,1,1,2,2,2,2) , x = rnorm(8) , y = rnorm(8) ) sf <- sfheaders::sf_multipoint(df, "x", "y", multipoint_id = "id") sf <- cbind( sf, sf ) sf <- setNames( sf, c("id1","geometry","id2","geometry.1")) origin <- c("geometry") destination <- c("geometry.1") attr( sf, "sf_column" ) <- destination sf <- sfheaders::sf_cast( sf, "POINT" )
The final column names are incorrect (using
geometry
as the column)but it works when the geometry is not
geometry