Humanitarian data exchange stores it's shapefiles as zipped files This function takes the results of the hdx_dataset_search, after being expanded by hdx_resource_list function, and downloads the first shapefile to the working directory. It will create a new folder with the name of the shapefile, and unzip the shapefiles into it. It will then load the first shapefile from this directory into the environment, in simple features format.

hdx_resource_shapefile(resources)

Arguments

resources

Results of hdx_resource_list

Examples

dataset <- hdx_dataset_search() resources <- hdx_resource_list(dataset) shapefile <- hdx_resource_shapefile(resources)
#> Reading layer `hotosm_syr_waterways_lines' from data source `R\hdxr\docs\reference\hotosm_syr_waterways_lines_shp' using driver `ESRI Shapefile' #> Simple feature collection with 4534 features and 12 fields #> geometry type: MULTILINESTRING #> dimension: XY #> bbox: xmin: 35.73927 ymin: 32.48942 xmax: 42.38901 ymax: 37.32029 #> epsg (SRID): 4326 #> proj4string: +proj=longlat +datum=WGS84 +no_defs