Open dasalm20 opened 1 month ago
@DianaJaganjac ,
I tested the latest function for population and I get the following error:
downloaded 50.0 MB
[1] "Population Raster Downloaded" [1] "Initiating shape object tesselation" [1] "Tesselation complete for shapefile extent, ensuring validity of shapefile ..." [1] "Limiting tesselated object to shapefile area ..." [1] "The shapefile is fully gridded!!" [1] "Ensuring geometries are properly fixed" [1] "The tesselated object represents a total area of 5171 km^2" [1] "The plot window should show you a distribution of the polygon sizes" [1] "Extracting raster/vector data into shapefile" [1] "CRS of raster objects: WGS 84" |============================================================================| 100% |============================================================================| 100% Error in if (!setting_geom) { : missing value where TRUE/FALSE needed In addition: Warning messages: 1: attribute variables are assumed to be spatially constant throughout all geometries 2: In st_collection_extract.sf(add_dt) : x contains no geometries of specified type
Hi Daylan,
I just used this example and it worked for me:
df <- geolink_population(iso_code = "NGA", UN_adjst = "N", constrained = "Y", shp_dt = shp_dt[shp_dt$ADM1_EN == "Abia",], grid_size = 1000, extract_fun = "mean", file_location = "C:/Users/Diana Jaganjac/Documents/New folder")
Please try again and let me know if it works for you.
You might need to double check your file location where you are downloading the data to.
Best wishes,
Diana
Hi Diana,
You are right, I think the issue was with the file_location. I will further test it and let you know.
Best, Daylan
Dear @DianaJaganjac,
I have tested the population function and it is currently failing. These are my findings:
I think that once it is created properly, the function should run without any issues.
This is the code that I am using:
test_dt <- geolink_population(iso_code = "NGA", UN_adjst = "N", constrained = "Y", shp_dt = shp_dt[shp_dt$ADM1_EN == "Abia",], grid_size = 1000, extract_fun = "mean", file_location = "/Users/nikos/Documents/temp")