nptscot / npt

Data processing code, also use this repo for issue tracking for the Network Planning Tool. See https://nptscot.github.io for development version
https://www.npt.scot/
GNU Affero General Public License v3.0
5 stars 0 forks source link

Error with coherent_network target #446

Closed Robinlovelace closed 5 months ago

Robinlovelace commented 5 months ago

Just hit this on #444 @wangzhao0217 can you reproduce this and any ideas how to fix?

✖ errored target coherent_network
✖ errored pipeline [1.055 minutes]
Warning message:
1 targets produced warnings. Run targets::tar_meta(fields = warnings, complete_only = TRUE) for the messages. 
Error:
! Error running targets::tar_make()
Error messages: targets::tar_meta(fields = error, complete_only = TRUE)
Debugging guide: https://books.ropensci.org/targets/debugging.html
How to ask for help: https://books.ropensci.org/targets/help.html
Last error message:
    OGR error
Last error traceback:
    cohesive_network_prep(combined_network_tile, intermediate_zones,      cr...
    MasterMap[sf::st_union(zones), , op = sf::st_intersects]
    `[.sf`(MasterMap, sf::st_union(zones), , op = sf::st_intersects)
    lengths(op(x, i, ...))
    op(x, i, ...)
    st_intersects.sf(x, i, ...)
    st_geos_binop("intersects", x, y, sparse = sparse, prepared = prepared, ...
    st_dimension(x)
    CPL_gdal_dimension(st_geometry(x), NA_if_empty)
    stop(list("OGR error", NULL, list("", -1L, c("/usr/local/lib/R/site-libr...
    (function (condition)  {     state$error <- build_message(condition)    ...
Robinlovelace commented 5 months ago

@wangzhao0217 can you reproduce it? I suspect it's caused by one of these lines:

https://github.com/nptscot/npt/blob/4dd81c85a52d2c1f9d4909241d5d736137e0f03f/R/coherent_network_prep.R#L33-L50