Skip to content

Conversation

@domisch
Copy link
Member

@domisch domisch commented Dec 10, 2024

Added a pre-selection of the 100 longest streams from which the most contributing (main) stream will be identified based on the area

Added a pre-selection of the 100 longest streams from which the most contributing (main) stream will be identified based on the area
@merretbuurman
Copy link
Collaborator

Hi! Thanks for the contribution!
Unfortunately I could not get the example to run. This is what happens:

> pfafstetter <- get_pfafstetter_basins(g = g_subset, subc_raster = subc_raster,  out_dir = my_directory, file_name = "pfafstetter_raster.tif",  data_table = FALSE,  n_cores = 4)
Setting up parallel backend...
Using 4 CPUs... 
Preparing the graph...
Calculating the area of single sub-catchments...
Finding the most contributing stream... 
Error in setnames(x, value) : 
  Can't assign 1 names to a 0-column data.table
> 

Some hint:
During testing, I found out that after the line cat("Finding the most contributing stream..."), the object headwater is an object of type character with a length of hundred, but it has no names - length(names(headwater)) is zero, so maybe that is what causes it to fail? names(headwater) is used repeatedly in the lines after that. But I didn't debug any further yet.

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

Successfully merging this pull request may close these issues.

3 participants