malaria-atlas-project / malariaAtlas

An R interface to open-access malaria data, hosted by the Malaria Atlas Project.
https://malariajournal.biomedcentral.com/articles/10.1186/s12936-018-2500-5
Other
43 stars 21 forks source link

Bug: shapefiles for the USA not loading properly #32

Open bertozzivill opened 5 years ago

bertozzivill commented 5 years ago

I use malariaAtlas in my example script for making custom accessibility surfaces. In the past, I've used the following getShp code to download a shapefile for Colorado state:

USA.shp <- malariaAtlas::getShp(ISO = "USA", admin_level = "admin1") analysis.shp <- USA.shp[USA.shp@data$name=="Colorado",]

Running this code now returns analysis.shp as a SpatialPolygonsDataFrame with 0 features, which makes sense because the @data field of USA.shp is no longer populated:

screen shot 2019-01-22 at 5 53 16 pm

The same is true for other non-malaria-endemic countries like Italy, but countries like Zambia and Vietnam load just fine. Are there now only subnational shapefiles available for endemic countries? Can we bring the non-endemic countries back?

timcdlucas commented 5 years ago

I guess we switched to map 2018 shapefiles witch might be endemic only.

I think we don't want to simply switch back because there's lots of lower admin units only in the new one. So I think we might need to try and return a mish mash.

I'll email Suzanne and Jen and see if they can work out something sensible.

bertozzivill commented 5 years ago

Great, thanks. My current use case is fairly small/specific, but even outside malaria modeling a library with easily-downloadable global shapefiles is extremely useful.

timcdlucas commented 5 years ago

Ok, we (Suzanna) are going to fix this. But it's not trivial so it'll take a little while.

It was caused by switching to the new shapefiles by the way.

bertozzivill commented 5 years ago

Much appreciated, thanks to all!