saferactive / trafficalmr

R package to support road safety and traffic calming measures
https://saferactive.github.io/trafficalmr/
GNU General Public License v3.0
5 stars 1 forks source link

Check issue associated with sf #49

Closed Robinlovelace closed 4 years ago

Robinlovelace commented 4 years ago

Strange one, hard to debug, saying there is no sf column name: https://github.com/saferactive/trafficalmr/runs/1233734119#step:12:134

  > x = osm_main_roads(tc_data_osm)
  > junctions = osm_get_junctions(x)
  Error in st_geometry.sf(x) : 
    attr(obj, "sf_column") does not point to a geometry column.
  Did you rename it, without setting st_geometry(obj) <- "newname"?
  Calls: osm_get_junctions ... st_cast.sf -> st_cast -> st_geometry -> st_geometry.sf
  Execution halted
Robinlovelace commented 4 years ago

Specifically...:

x = osm_main_roads(tc_data_osm)
  > attr(x, "sf_column") = "geometry"
  > class(x$geometry)
  [1] "list"
  > junctions = osm_get_junctions(x)
Robinlovelace commented 4 years ago

Related to: https://github.com/r-spatial/sf/issues/1185