Closed AdrienDams closed 4 months ago
The problem is that new versions of GADM have renamed the column "NAME_0" into "COUNTRY". I encountered this before. I think it works again if you replace "NAME_0" with "COUNTRY" in line 62 of 3_map_countries_to_grid_collection.R. You will also have to change 6_map_districts_to_grid_collection.R if you plan to run all scripts in the gadm
directory.
Thanks for the nearly instant answer! What a odd choice from them to decide to rename "NAME_0" into "COUNTRY", but keeps "NAME_1".
I changed what you told me but I think this is not the only change needed. In line 676 level0 <- unlist(country_list[sort_order])
is likely not working. I am not a R expert but country_list[sort_order]
gives:
$ABW
character(0)
$AFG
character(0)
$AGO
character(0)
$AIA
character(0)
$ALA
character(0)
$ALB
character(0)
$AND
character(0)
...
and level0
gives:
character(0)
Can you check if there is a "celllist_*:RData" file in the working directory? If so, please try to delete it and then run 3_map_countries_to_grid_collection.R
again.
It solved it! Thanks
I am trying to simply run GADM with the default grid and the last GADM files (4.10).
While running
3_map_countries_to_grid_collection.R
, I have this error:I think the error comes much earlier, for example my array "level0" is nearly empty:
I guess this is related to "Info: There are 17012 cells exceeding land fraction of 1 by a maximum of 305030 which will be cut to 1". I had a couple of warning messages in the previous steps but nothing serious.
Any help?