sitrep icon indicating copy to clipboard operation
sitrep copied to clipboard

Spatial analysis issues

Open aspina7 opened this issue 6 years ago • 19 comments

I have added a basic section to spatial analysis using the "tmap" package (with "tmaptools" too). I chose this because it allows both sf and sp files and has similar syntax to ggplot2 but simpler for manipulating spatial data. The reason I decided against ggmap - is that it really didnt work well in the field on poor internet connection (would often just get kicked out and it wouldnt download at all) - and the style options arent great either. In general tmap is quite a nice package, allowing for static and interactive maps. That comes with issues though as it has a lot of dependencies!

The biggest issue is that to get static tiles it uses the "openstreetmap" package which is rjava dependent and produces quite poor resolution rasters. For interactive maps it uses leaflet package. Which has great tile backgrounds but only interactive ones. Leaflet also has more server options, and particularly important is that it supports openstreetmap black&white as well as humanitarian openstreetmap (no other packages seem to provide these and they are the most important ones!!).

It would be really awesome if we could somehow manage to pull leaflet backgrounds in to static tiles. Alternatively "openstreetmap" package allows to specify server destinations to pull tiles from - so maybe theres a possible work around in there?? (just need to find a stable server with an api?)

The second thing I couldnt seem to get to work is creating kernel density (or heatmaps) - using the smooth_map function from the "tmaptools" package - based on points data.

If we manage a work around for getting tiles in (and dont want all the dependencies of tmap) then using the sf package with ggplot2 is equally simple and functional!

aspina7 avatar Jan 10 '19 11:01 aspina7