Archive | Maps RSS for this section

Mapmaking with ggmap

I am always looking for free alternatives to ArcGIS for making pretty maps. R is great for graphics and the new-to-me ggmap package is no exception.

I’m working with some data from Botswana for a contract and needed to plot maps for several years of count based data, where the GPS coordinates for facilities were known. ArcGIS is unwieldy for creating multiple maps of the same type of data based on time points, so R is an ideal choice…. the trouble is the maps I can easily make don’t look all that good (though with tweaking can be made to look better.)

ggmap offered me an easy solution. It downloads a topographic base map from Google and I can easily overlay proportionally sized points represent counts at various geo-located points. This is just a map of Botswanan health facilities (downloaded from Humanitarian Data Exchange) with the square of counts chosen from a normal distribution. The results are rather nice.



#read in grographic extent and boundary for bots
btw <- admin<-readOGR(“GIS Layers/Admin”,”BWA_adm2″) #from DIVA-GIS

# fortify bots boundary for ggplot
btw_df <- fortify(btw)

# get a basemap
btw_basemap <- get_map(location = “botswana”, zoom = 6)

# get the hf data<-read.csv(“BotswanaHealthFacilitiesOpenStreetMap.csv”)
# create random counts$Counts<-round((rnorm(112,mean=10,sd=5))^2,0)

# Plot this dog
ggmap(btw_basemap) +
geom_polygon(data=btw_df, aes(x=long, y=lat, group=group), fill=”red”, alpha=0.1) +
geom_point(, aes(x=X, y=Y, size=Counts, fill=Counts), shape=21, alpha=0.8) +
scale_size_continuous(range = c(2, 12), breaks=pretty_breaks(5)) +
scale_fill_distiller(breaks = pretty_breaks(5))


Kenya 2017 Election Violence: Some Data Analysis

I’m getting used to the new version of ArcGIS (which is a vast improvement!) and gave it a test run on some data from the ACLED (Armed Conflict Location & Event Data Project) database, specifically on this years round of violence surrounding the Kenyan election. ACLED keeps real time data on violence and conflict around the globe, the latest entry in 2017 is Nov 24, just five days ago.


The first election occurred on August 8th, 2017. The opposition contested the results of the election, claiming problems in vote tallying by the IEBC, resulting in a nullification by the Supreme Court. A new election was called and was to be conducted within 60 days of the nullification. Raila Odinga, the opposition leader, claimed that the election again would not be fair, dropped out of the race and called for a national boycott. The election went ahead as place on October 26, 2017 and Uhuru Kenyatta was declared the winner.




There was violence at every stage of the process, both by rioters in support of the opposition and by the police and military who were known to fire live rounds into groups of demonstrators. Opposition supporters were known to set fire to Kikuyu businesses. Local Kikuyu gangs were reported to be going house to house rooting out people from tribal groups from the West and beating them in the street. Tribal groups in rural areas were reported to be fighting amongst one another. The police response has been heavy handed and disproportionate leading to a national crisis.

As of now, though not nearly as violent as the post election violence of 2007-08, the violence has not yet abated.

In the database, there were 420 events logged, including rioting, protests and violence against civilians by the state, police and local tribal militias. There are 306 recorded fatalities in the data base, but this number should be approached with some caution. There were likely more. The database is compiled from newspaper reports, which don’t count fatalities and don’t cover all events.
ViolentTSI made two maps (above), one for Nairobi, and the other for Kenya. They include all non Al-Shabaab events (a Somali Islamist group the Kenya Defense Force has been fighting for several years.) I also included a time series of both events and fatalities.

Some excerpts from the notes:

“Police raided houses of civilians in Kisumu, beating civilians and injuring dozens. Live bullets were used on some civilians, including a 14 year old boy. Of the 29 people injured, 26 had suffered gun shots.”

“One man was found dead in a sugar cane plantation one day after ethnic tensions between the Luo and Kalenjin communities got into an ethnic clash. The body had been hacked with a panga.”

“Rioters started throwing stones at the police in the morning, protesting against the elections to be held the next day. The police responded with teargas and water canons. The rioters were mostly from the Luo ethnic group and they took the opportunity to loot several stores, attack residents and to burn a store owned by an ethnic Kikuyu. One woman was raped.” *This was in Kawangware, not far from my apartment. I was eating at a local bbq place when this happened. 



“Police forces attacked supporters of the opposition that went to the Lucky Summer neighbourhood to check on a ritual of beheading of a sheep that was taking place (suspectedly by the Mungiki sect). The police shot at the civilians. The police confirmed that it shot a man and that the group performing the ritual had sought protection.”

“As a revenge to the previous event, the Kikuyu joined forces and attacked the Luo. The ethnic tensions and violence led to one severely injured person. Residents claims three were killed and dozens, including three school children, were injured.”

Snake Bites in Kwale, Kenya: Into the Field

snakebitesWe just spent the day driving around Kwale looking for snakes, and/or people who had been bitten by snakes. As the last post showed, snakebites are a persistent problem along the Kenyan Coast, with more then 5% of the households we survey indicating that at least one person in the household had been bitten in the past two years.

It wasn’t difficult to find them.

Snakes are universally feared all over Africa and the associations with witchcraft make it a common topic of discussion. Everyone knows someone who has been bitten. They often know all the details, including where it happened and what occurred following the bite. It’s never a happy story.

We went deep into Kinango, an extremely rural area west of Kwale Town and found a friendly lady who seemed to know everything about everyone. She was incredibly jolly, pulled out some plastic chairs for us to sit under and cracked jokes the whole time. I even got to copy her collection of Sangeya music which she had recorded on her phone (another post but you can hear some of it here) at some local music festivals. In total I got more than five hours of live Sengeya and Chilewa music. In the music world, these would be called “field recordings.” Here, this is just music she cooks and cleans to.

Switching back and forth between snakes and Sengenya (in Africa it seems to be possible to have multiple conversations at once), she told us about a kid who had been bitten two days previous. She even told us where to find her, so off we went.

The child was collecting firewood around a mango tree near her home, when she was suddenly bitten by a large green snake, not once but three times on the foot. The snake bit once skated away, decided it wasn’t enough and came back and bit her twice more.

Ants had moved into the dead tree and hollowed out the area underneath. Presumably, the snake moved in previously and came out to warm up during the day.

The mother thankfully took the child immediately to Kinango Hospital and treated was administered. The child was given a three day course of antivenom injections and charcoal was wrapped around the wounds to absorb any venomous discharge. Though the child complains of some numbness in the area, it looks as if there won’t be any permanent damage. Thankfully.


Snake bite (species unknown). Note the charcoal. Victim is a 10 year old girl.

We were also told of an old woman who had been bitten more than 20 years ago, and was badly scarred, figured out where she was and off we went again.

As we pulled up a friendly young lady came out to greet us, and showed us the way to the house out back. In the distance, we could see an old lady walking with a limp. Otherwise, she was completely fit and seemed to be cutting her own firewood with a panga.

She brought us out some chairs and sat down to chat. In 1992, she had been out back collecting firewood (a pattern) and was bitten on the foot by puff adder, one of the deadliest snakes in the world. She was bitten on the foot, and became immobile for nearly a week. A series of witch doctors were brought in, who administered charcoal rubbed into small cuts in the skin.

Necrosis set in, and watery blood erupted out of the wound site. A large number of maggots appeared. Finally, someone had the good sense to take her to the hospital, where she spent an entire year.

The details were unclear, but it appeared that the gangrene was so severe that multiple infections were presents. They likely had her on intravenous antibiotics for an extended amount of time. Despite this, the foot did not heal. Some Christian missionaries came, and convinced her to convert to Christianity, which, she claimed, improved her condition. This is likely coincidental.


Puff Adder wound. Note the permanent curvature of the foot. She continues to have to wrap it and use topical medication, 24 years following the bite.

The doctors suggested a skin graft to improve the foot, but she refused. Necrosis was so deep that it permeated the bone and the foot is permanently curved as a result. The leg still shows sign of swelling even more than 24 years after the bite. In most cases, they probably would have simply amputated.

The lady was born in 1948, bore ten children, one of which was born just as she was bitten. She was unable to breast feed or care for the child. Regardless, the daughter has two children of her own now.

Snakebites are bad news. In this woman’s case, the disregard for proper medical care simply made a bad situation worse. She is truly lucky to be alive. If she had died, it is doubtful that the Mgangas would have admitted any responsibility.


Puff Adder victim, born in 1948. Ten kids. Still going strong.

The Jigger flea: a neglected scourge

Jigger infestation of the hands. I picked the least awful picture I could find. Note the deformity of the hands. This person has likely been suffering from infections since childhood.

Jigger infestation of the hands. I picked the least awful picture I could find. Note the deformity of the hands. This person has likely been suffering from infections since childhood.

I just learned about probably one of the most horrible dieases I’ve ever seen: the jigger. Tunga penetrans is one of the smallest fleas around, less than 1 mm in length. The gravid female attaches itself to a mammalian host, burrows into the skin head first leaving its read end exposed for breathing and defecation. It feeds on blood from the subcutaneous capillaries and proceeds to produce anywhere from 20-200 eggs. Under the skin it can grow to nearly 1 cm in width.

Tunga penetrans is native to South America, was brought to West Africa through the slave trade. In the mid 19th century it was brought on an English shipping vessel and made its way through trade routes and is now found everywhere throughout the continent.

Bacteria opportunistically invades the site and super-infections (multiple pathogens) are common. Victims suffer from itching and pain and multiple fleas are common. Due to the location of the bite, people often have trouble walking and due to the disgusting nature of the infection, victims are stigmatized and marginalized. Worse yet, the site can becomes gangrenous and auto-amputations of digits and feet and eventually death are not uncommon.

The Parliaments of both Kenya and Uganda have introduced bills in the past calling for the arrest of people suffering from jiggers. Of course, these ridiculous bills don’t come with public health actions to control the disease.

Jiggers are entirely preventable, treatable through either surgical excision or through various medications but risk factors for it are mostly unknown and the data contradictory and mostly inconclusive.

It sometimes occurs in travelers and is easily treated in a clinic on an outpatient basis but is a debilitating infection for poor communities. Thus, it is not taken seriously by international public health groups who choose to focus on big issues like HIV and malaria.

Jiggers are a classic example of the neglected tropical disease: it devastates the poorest of the poor but gets almost no attention from donors or the international press.

We gathered some data on jiggers back in 2011 along the coast of Kenya. Without presenting these results as official, I was drawn to the attached map.

Animals of various species have been implicated as reservoirs for the disease, most notably pigs and dogs. Less understood is the role of wildlife in maintaining transmission. On the map below, the large yellow dots represent cases. Note that they are nearly all located along the Shimba Hills Wildlife Reserve. I calculated the distance of each household to the park’s border (see the funny graph at the bottom), and found a graded relationship between distance and jiggers infections. Past 5km away from the park, the risk of jiggers is nearly zero.

What does this mean? I have ruled out domesticated animals, at least as a primary reservoir. People in this area tend to all own the same types and numbers of animals. Being Islamic, there are no pigs here, but dogs are found everywhere. Despite this, there are distinct spatial patterns which are associated with the park. Note that all of the cases are found between the parks border and a set of lakes, perhaps implying that certain wild animals are traveling there for water and food.

The ecology of jiggers is very poorly understood and, like many pathogens (like Ebola, for example), wildlife probably play an important role.

It’s worth paying me a lot of money to study it.

Locations of jiggers cases. note the proximity to the park.

Locations of jiggers cases. note the proximity to the park.

Distance to wildlife reserve and jiggers risk. Note that risk drops until 5km, then becomes nearly zero.

Distance to wildlife reserve and jiggers risk. Note that risk drops until 5km, then becomes nearly zero.

(Mostly) Vindicated: Euclidean measures of distance are just as good as high priced, fancy measures

DistancePlotsITNIn my seminal paper, “Distance to health services influences insecticide-treated net possession and use among six to 59 month-old children in Malawi,” I indicated that Euclidean (straight line) measures of distance were just as good as more complicated, network based measures.

I didn’t include the graph showing how correlated the two were, but I wish I had and I can’t find it here my computer.

Every time I’ve done presentations of research of the association of distances to various things and health outcomes, someone inevitably asks why I didn’t use a more complex measure of actual travel paths. The idea is that no one walks in a straight line anywhere, but rather follows a road network, or even utilizes a number of transportation options which might be lost in a simple measure.

I always respond that a straight line distance is as good as any other when investigating relationships on a coarse scale. Inevitably, audiences are never convinced.

A new paper came out today, “Methods to measure potential spatial access to delivery care in low- and middle-income countries: a case study in rural Ghana” which compared the Euclidean measure with a number of more complex measurements.

The conclusion confirmed what I already knew, that the Euclidean measure is just as good in most cases, and the pain and cost of producing sexy and complicated ways of calculating distance just isn’t worth it.

It’s a pretty decent paper, but I wish they had put some graphs in to illustrate their points. It would be good to see exactly where the measures disagree.

Access to skilled attendance at childbirth is crucial to reduce maternal and newborn mortality. Several different measures of geographic access are used concurrently in public health research, with the assumption that sophisticated methods are generally better. Most of the evidence for this assumption comes from methodological comparisons in high-income countries. We compare different measures of travel impedance in a case study in Ghana’s Brong Ahafo region to determine if straight-line distance can be an adequate proxy for access to delivery care in certain low- and middle-income country (LMIC) settings.

We created a geospatial database, mapping population location in both compounds and village centroids, service locations for all health facilities offering delivery care, land-cover and a detailed road network. Six different measures were used to calculate travel impedance to health facilities (straight-line distance, network distance, network travel time and raster travel time, the latter two both mechanized and non-mechanized). The measures were compared using Spearman rank correlation coefficients, absolute differences, and the percentage of the same facilities identified as closest. We used logistic regression with robust standard errors to model the association of the different measures with health facility use for delivery in 9,306 births.

Non-mechanized measures were highly correlated with each other, and identified the same facilities as closest for approximately 80% of villages. Measures calculated from compounds identified the same closest facility as measures from village centroids for over 85% of births. For 90% of births, the aggregation error from using village centroids instead of compound locations was less than 35 minutes and less than 1.12 km. All non-mechanized measures showed an inverse association with facility use of similar magnitude, an approximately 67% reduction in odds of facility delivery per standard deviation increase in each measure (OR = 0.33).

Different data models and population locations produced comparable results in our case study, thus demonstrating that straight-line distance can be reasonably used as a proxy for potential spatial access in certain LMIC settings. The cost of obtaining individually geocoded population location and sophisticated measures of travel impedance should be weighed against the gain in accuracy.

The famous “aho/baka” map of Japan.

ahobaka1Japan, despite the refined image it traditionally likes to present to the world, has no shortage of words with which to call people stupid.

These words are mostly regional and the uses and nuances of calling people stupid also vary by place.

Over dinner, I was reminded of an episode of Tante Night Scoop, an investigative television program which ran throughout the 90’s. They did an exhaustive survey and mapped the locations of the common ways of calling people stupid throughout Japan.

Of interest is the centrality of the word “aho,” commonly used throughout the Kansai region of Japan (and denoted in red) and the radial spread of “baka” (denoted in blue), a word mostly associated with Tokyo and commonly found in Kanto-centric anime programs.

The map was intended as entertainment, but it has serious historical significance.

When people move, they take words with them. It would appear that people in Kansai, historically the political and economic center of Japan, had little reason to leave the region, which would explain “aho”‘s limited spread. Baka, however, can be found on both sides of Kanto, indicating that there were strong connections between the two sides, despite the distance between them.

Oddly, the other words for “stupid” occupy the same radii from Kansai indicating that certain groups of people had peculiar spatial advantages in trade, where as others did not. Though I really have no idea, I’m thinking that particular perishable products traded with Kansai might have different spoiling times necessitating particular proximities. It’s important also to note that the extreme peripheries might have been trading non-perishable resources like coal, which, though heavy, doesn’t rot.

Economics, trade and language have deep links. English wouldn’t exist without it, and the many forms of English spoken throughout the world have been influenced by the multitude of groups of people who chose to speak it to facilitate trade.

OK, enough for now and back to Kenya.

US Bombing of Laos: 1965 -1973: I was there first

Actually, I was an infant, but as an adult, I wrote a blog post and made a cool video of the locations and magnitude of bomb drops in Laos from 1965-1973.

Now, Jerry Redfern & Karen Coates have written a great (I assume) book “Eternal Harvest”on the United States’ unbelievably devastating bombing campaign of neighboring Laos during the Vietnam War. I suggest that everyone go out and read this book immediately.

However, they created an accompanying video, which is eerily similar to a video I created, though theirs is embellished with narration and bookend explanations. I want to think that I helped inspire such a cool video. Or maybe this is wishful thinking. I don’t know. But it’s reassuring to know that this blog might have contributing something to the world.

Here’s theirs:

And here’s mine:

%d bloggers like this: