What it does
Produce estimates of the total population that is accessible via road.
How I built it
I utilized R for the majority of this project. When converting the png road files back to geo-referenced tiff files I used a python script that accessed the mercantile utilities to retrieve the bounding box for each image based on its quadkey.
For the rest of the data cleaning and analysis I called GDAL command line utilities from r for a number of raster I/O operations and conversions.
To build the distance to road raster I ran gdal_proximity which takes a binary raster represent roads presence absence and then for each pixel calculates the euclidean distance to the closest no zero pixel. I then overlaid the population data points and extracted the pixel value at each point to get the distance to the closest road.
From their I used the distance raster to calculate a transition matrix layer which was used for the routing portion of this challenge. The transition matrix was used to calculate the shortest path between two coordinates weighted by the distance from road if the starting or ending location was not along a road.
Challenges I ran into
I ran into time constraints and as well as a few memory/processing limits. The road data had a resolution of approximately 0.5m X 0.5m and covered a 30km X 30km area so after aggregating all road data file management became fairly important.
I also had a problem with the initial pngs. Thirty of the 64 had road data stored in the alpha band and the other 34 only had a single band. Luckily this error appeared early.
What I learned
I learned to rely on python a little more then in any previous work. Python has many spatial utilities that are very useful and often more efficient then there counterparts in R so having the flexibility to work interactively between both is a great advantage I look forward to using.
What's next for Tanzania Population Proximity to Roads
Compare the machine learning (ml) road data to OpenStreetMap (OSM) data.
Log in or sign up for Devpost to join the conversation.