
So I know the question will come up at some stage so I thought I would just skip to the spoiler. Why? Well because one night about four months ago I was busy defragging by brain while trying to go to sleep and though to myself, “Is it possible to predict where a business should build their branches based on satellite data alone?” So let me Let me regale you with the story of how I set about to find the answer. I decided to focus on Cape Town specific as I might be a bit bias. And it was very nice to lean something new about a place I call home.
The famous quote by Carl Sagan says, “If you wish to make an apple pie from scratch, you must first invent the universe.” And that is almost what I had to do, figuratively speaking of course. I had to start from scratch and build every step one at a time. Sure I checked to see if there where some applications that I could just plug my request and as of the start of the project there where none however google released Planetary Prediction Engine on the 27’th of August that would now be able to do all of what I made over four months in a couple of minutes. Much faster yes, but then I would not have learnt all I had doing it all “by hand”.
My main steps in this process where:
- Finding useful data
- Mapping historical growth over time
- Predicting future growth
- Predicting where to place new branches and ATM’s
Data sources
To invent the universe to bake your apple pie you need ingredients in this case a ton of satellite photos and data derived from the satellite images. Normally I would need to take the raw images and convert them into numerical data by training a custom model to recognize buildings, roads, mountains and so on. As fun as that sounds, and I’m actually no being sarcastic, it would have taken me time times longer to finish this project. Luckily for me people much smarter than me did most of the hard for for me and all I had to do was to mix the ingredients.
In total this project used about 22GB of data made up of 114404 files and 11690 folders. That is a lot of ingredients. Just to give you an idea. Most of the time I worked with raw data and only used the images as reference to make sure I was still on the right track. Below is an example of the kind of data I was working with. In this case each line represented a 10×10 meter area and all the other columns described the properties of that section of land. Most was in CVS format but there was some XML, JSON and TIFF (not the image format) in there as well.

However looking at numbers can get boring so below is a short video where I combined all the visual representations of the data. All in all I downloaded 29 datasets but ended only using about ten percent of them as they best suited my needs for this project. Not only did I download multiple number of datasets I also downloaded a wide data range of each one of one. Some going back to 1970’s. The video shows a small time laps of each.
Below is a list of all the maps I managed to obtain that you can see in the video below:
- Buildings & Paved Areas Map: shows where buildings and paved surfaces are versus natural land
- Bare Soil Map: shows how likely each spot is to be bare dirt with nothing growing on it
- Built-Up Areas Map: shows how likely each spot is to be a building, road, or other man-made surface
- Water Likelihood Map: shows how likely each spot is to be water
- Enhanced City View: a color-boosted satellite photo that makes city buildings easier to spot
- Enhanced Greenery View: a color-boosted satellite photo that makes plants and greenery stand out
- All-Weather Radar Image (rough surfaces): a radar picture that works day or night and through cloud; good at picking out rough things like plants and buildings
- All-Weather Radar Image (smooth surfaces): a radar picture that works day or night and through cloud; good at picking out smooth things like water and flat ground
- Regular Satellite Photo: a normal-looking satellite photo, like what you’d see from a plane
- Plant Health Map: shows how healthy and thick the greenery is in each area
- Hidden Water Map: highlights water that’s hard to see in a normal photo, even if it’s shallow
- Night Lights Map: shows how much artificial light shines at night; a rough sign of how busy or developed an area is
- Building Density Map: estimates how many buildings are packed into each area
- Building Confidence Map: shows how sure the data is that a building actually exists at that spot
- Official Building Outlines: the city’s own map of buildings, traced from rooftops
- Special Plant-Health Photo: a special type of photo that’s great for showing plant health and land use
- Population Map: shows roughly how many people live in each area
- Non-Home Buildings Map: shows how much land is covered by buildings that aren’t homes, like offices, shops and factories
- All Buildings Map: shows how much land is covered by any kind of building at all
- City vs Town vs Rural Map: classifies each area as city, town or rural based on how built-up and populated it is
- Height Above Sea Level Map: shows how high the ground is at each point
- Worst-Case Flood Depth Map: shows how deep water would likely get in a very severe, rare flood
- Flood Risk Map: shows how high each spot sits above the nearest stream; a clue to flood risk
- River Width Map: shows how wide the rivers are at each point
- Steepness Map: shows how steep the ground is at each spot
- Slope Direction Map: shows which way each slope faces, like north or south
- 3D Shaded Terrain Map: a shaded picture that makes hills and valleys easier to see
- Water Catchment Map: shows how much land drains into that point; bigger numbers mean more water could flow through there
- How Often It’s Wet Map: shows how often that spot has been covered by water over time
Please note for some reason embedded videos tend to play at a very low quality so you might need to manually change the resolution to 1080p or higher to see all the details.
So where did I get all this amazing data? Most of the satellite data came through Google Earth Engine. The main satellite archive covered 2015 to mid-2026, using Copernicus Sentinel-1 and Sentinel-2, with Landsat 7, 8 and 9 as additional sources. Key comparison images were taken from 2016, 2023 and 2025. For the long-term history of Cape Town’s expansion, I used the JRC Global Human Settlement Layer from 1975 to 2020. Its latest underlying satellite observation is from 2018. I then used Google Open Buildings, which provides annual building information from 2016 to 2023, to create a combined urban-growth timeline running from 1975 to 2023. GHSL and Open Buildings Temporal The City of Cape Town’s aerial imagery and roof records covered December 2013 to January 2025. Mountain and elevation data came from the static Copernicus DEM GLO-30 dataset. Historical surface-water information came from JRC Global Surface Water, covering 1984 to 2021. Flood depth came from the JRC CEMS GLOFAS flood-hazard scenarios, and river networks and drainage came from MERIT Hydro. The terrain, flood and river layers are physical reference layers rather than yearly time series. JRC Global Surface Water Land-cover information came from Dynamic World, with 2023 used as the main reference year. Population information came from WorldPop, with the project using the 2020 estimate. Night-time lighting came from NOAA VIIRS, comparing 2016 with 2023. Climate information came from monthly ECMWF ERA5-Land data covering the project period from 2015 to mid-2026. Finally, roads and other geographic features came from an OpenStreetMap snapshot dated July 2026, downloaded through Geofabrik and supplemented with the Overpass API.
Mapping growth over time
Well now that I have all the juicy data, where shall we start. Well lets see how the city and surrounding areas have grown in the past to see if we can get some data from that. I found two main datasets one from 1975-2023 and one from 2016 to 2023. I did find other data that had up to date data, however there where not enough overlap and historical data to make any good use of it. So I ended up mostly only using the data from 2016-2023 as this dataset had the most “bang for my buck” as they say. I did however decide to map the expansion for 1975-2023 along with a combination of the dataset for 2016-2023 just to see how Cape Town grew from back in the day to modern times.
1975-2023
Below is an historical account of how Cape Town expanded from 1975 on wards. This is rather impressive as back in the day all of this had to be done by hand, no satellites, computer or even cellphones to help you out. Just pen, paper and that gray stuff we all now swapped for AI.

Here are the same data but only shown in different ways. Below shows the grown as “air streams” that indicates the direction and intensity of the city growth.
This is the same data but only color coded and arrows showing the direction of growth. Interesting how you can represent the same type of data in vastly different ways.

This one I think is the most clear of all as you can see where new buildings was built over time with the brighter colors showing newer developments over time. You will see this type of image a couple of times, not because I use the same data over and over, but because the scale of the data being used. If you view this image full size then each tiny pixel would be about 10 meters or more. If you would view a zoomed in version of any of the maps shown you would see a much great pace of acceleration in development.

Cape Town’s rate of urban expansion has varied dramatically rather than increasing steadily. Construction accelerated sharply in the late 1990s, slowed in the early 2000s, and then began rising again after 2016. The fastest growth appears around 2021, when roughly 1,250 hectares of new built-up surface were added, before settling near 1,000 hectares annually in 2022 and 2023. The earlier figures are based on five-year GHSL intervals, so they show the broad long-term pattern rather than precise yearly fluctuations. I wonder what happened around about 1994 in South Africa? 🙂

2016-2023
As mentioned above I mostly used the data from 2016-2023 as this was the most complete and unbroken dataset I could find. It would have been nice to have gotten more data, but this project was project to be going on for a couple of month already and my urge to do multiple projects at the same time was getting stronger by the day. You can see there are a lot more happening in this video compared to be first one. Well for one, its over a shorter time span and two, there where actually more development going on as you will see a bit further below.
One thing I also needed to know was not how much and where development took place but also what direction. No spoilers but I am going to use this later.

This figure above shows that Cape Town’s expansion has not followed one fixed compass direction. Across 2013–2025, the strongest overall movement was broadly east and northeast, with additional growth toward the north and northwest. However, the period-by-period chart shows those directions changing over time, with some intervals leaning south, west or east. In other words, Cape Town has expanded through a series of shifting development fronts rather than spreading steadily in one direction. However the red shows the major direction most city growth went. If you would overlay this over a map of Cape Town and look at it then it would be hard not to see how development moved away from the mountains like Table Mountain, well I assume because well you can not build on a cliff,mountain or in the ocean so you would need to find places where you can.
Below are the same two visualizations as the more historical dataset. However this time you can clearly see where buildings where being built over time. The highlighted areas are much smaller then before because of the much smaller time frame and thus had less time to build new buildings. You know these things cost money and hard work and time to build.


Here below I’ve created some zoomed in example of some sections that had particularly high rate of growth. Adding what I call flow lines you can clearly see not just the rate of development, but also the direction buildings where built. I found it interesting how visualizations sometime used in weather for casting can be applied to building development.

Predicting future growth
Now that we have some idea of what happened in the past we can start to try and predict where future buildings will be built. Unfortunately it’s not as simple as just looking at where things seems to go and just point in the same direction. Well you can, but that seems more like something you would discuss over a braai with a beer than anything resembling a scientific method. I mean sure you can poke so many holes in my approach I can rename this project the Swiss cheese building predictor. Then again I do not really care since this whole project was another one just to see if I could.
1. Load data
OK, back on track.. I mentioned above most of the data was already converted to actual usable data. Basically neat(ish) X and Y coordinates saying yes a part of a building is here or not. All of this on a really decent 10×10 meter resolution. And over multiple years. Any nerd’s dream! Don’t you think so?

2 Clean Data -Noise Removal
As mentioned above the data is clean(ish) well it actually really is however for my needs I needed to do some additional post processing. Below shows the image of buildings from oldest (bright) to newest (dark). You can already see, same as above some patterns starting to appear but we are getting ahead of ourselves here. We need clean data to work from.

The issue is that the data might be almost perfect, but no data is 100% perfect. There might be noise in the data. It has been gathered from really high up you know. Also someone might have built a temporary structure and took it down after a while, but then that structure would have a permanent mark for the entire range of historical data, even if the structure was just put up and remove on the day the reading was taken. That would have warped the data a bit, or a lot in fact. So first thing I needed to do was remove all the “blips” in the data and only count actual building that was built and left there. Not just something overnight. The below map shows exactly that. I know the map is zoomed out a bit but you can still see colored spots here and there that indicated something was marked as a building in one time frame and then it disappeared in another. Sure actual buildings do sometimes get demolished however in this time frame I used this was more the outlier than the norm.

If you spent more than 2 seconds looking at the above image you would have noticed a colorful dot near the middle. Well I spent way more then 2 seconds looking at all the images and I wanted to know more so I decided to find this spot on google earth and see why this spot has so much red and yellow in it VS surrounding areas. After downloading all the historical data I could find I found that this specific area has undergone a lot of change with building being built, moved and removed on a regular basis. If you look at the time laps below you will be able to make out the area and see the changes being made over time. Keep in mind the time laps was since google started taking satellite photos all the way to the present while the statistical visualization is only from 2016-2023. And since almost every building was individually mapped and tracked over this time you can almost see where buildings where built and then stopped being built due to what I presume is a seasonal flood area. Perhaps I found a way to detect building growth that is higher than the norm? Or perhaps just found something interesting to talk about over the proverbial water cooler.


3. Developable surface
Right now that we have data with buildings that was built and stayed around for the long run we need some additional ingredients in that universal pie of mine. I needed to build a developable surface. And yes that is a real word! It means something different but try and stop me from using it. The idea behind this is I needed to know where building can actually be built based on the available terrain. I mean you can not build on the side of a cliff, nor can you build in the middle of a river. So where can you build then? Well thanks to all the data from the multitude of data sources I was able to take my pick from the best data sets.

After looking though all the images and datasets I decided to use the following to build my developable surface map.
- Slope degrees : Shows terrain steepness. Bright areas are steeper; dark areas are flatter.
- Flood depth and river width : Shows areas affected by a modeled severe 500-year flood. Also shows estimated river channels and their widths. Brighter or thicker lines indicate larger channels or stronger flood features.
- Height above drainage: Shows how far land sits above nearby drainage channels. Darker areas are low-lying drainage zones; brighter areas are higher and generally less flood-prone.
- Suitability contours over satellite imagery: Shows colored contour bands representing changes in physical development suitability across the terrain.
- Historical water occurrence: Shows locations where surface water was observed regularly or occasionally, including coastal water, wetlands, and scattered water bodies.
- Buildable versus impossible land: A categorical mask separating land considered physically buildable from water, excluded areas, or locations treated as impossible for development.
- Upstream drainage area: Shows the river and drainage network, with stronger/larger channels representing areas receiving runoff from larger upstream catchments.

By combining all the maps into one I had a map where buildings not only could be built but also built safely. This map is not just black and white either. Since you can still build on the side of hills if your bank account is big enough. And technically you can build on top of table mountain, however since height is a factor worked into the final map also it would be very impractical to build on very high areas. interesting enough from this map you can see Robben Island is not completely flat as I initially thought.
Step 4 AI model to predict where buildings will be built.
So we now have the where can we build. But now we also need to know how buildings are being built. As in what pattern buildings will form based on existing buildings. If you have six identical buildings next to each other the chances are good the seventh will be built right next to number six. Or if you have a blog of four buildings opposite each other from another set of four buildings you can assume if another set of four buildings is built next to the existing ones the fourth set will be right across the road and so on. Basic pattern recognition. I opted for a basic logistic regression model as this I thought would give me the best results and any other model might have been overkill. Hindsight is 20/20….
Model input

I opted to use four inputs to the model. Each one I has to create based on the existing data.
Distance to built is a straight line distance from each empty cell to the nearest cell already built, computed on a coarsened grid to keep it fast across a century of simulated steps. It’s the single strongest predictor of the four. Rather than assume distance matters in one smooth way, the model sorts it into bands (very close, close, a few hundred meters, and so on) and learns a separate weight for each. Past 3 kilometers the model treats the chance of building as flatly zero, since that matches what the historical data actually shows.
Local built share looks at roughly the nearest 120 meters and asks how much of that immediate area is already built. This one turned out to be the trickiest: naively, cells surrounded by dense building get built far more often than cells surrounded by empty land. But once you only compare cells that already sit right on the built edge, that gap mostly disappears. An earlier version of the model didn’t correct for that and ended up predicting new growth filling in whole street networks inside already built suburbs. This version fixes that by learning the effect directly from the data instead of assuming it.
Neighborhood built share asks the same question over a much wider area, roughly 600 meters, and blends smoothly across space rather than switching on and off at a hard boundary. It captures something different from the 120 meter version: not whether a cell is hemmed in locally, but whether it sits in a generally dense or generally empty part of the city. The model is told that this effect can only ever push the build chance up as density rises, never down.
Built-edge adjacency is a simple yes or no: does this cell physically touch a cell that’s already built. It’s kept separate from the distance measure because the jump in build likelihood right at the built edge is sudden rather than gradual, so folding it into the smooth distance curve would have hidden a real, sharp effect.
Model results
Below are the results of the model I trained to try and predict where buildings be built based on existing buildings. Keep in mind.. this does not include terrain at all. This model assumes everything is built on a flat surface. The model performed well at identifying the general areas where future development was more likely, clearly outperforming random selection. It was less reliable at predicting the exact cells that would be built, so it works best as a broad growth-pressure map rather than a precise building-by-building forecast.

ROC AUC : 0.880: The model is very good at ranking places that were built on above places that remained empty. A score of 0.88 is strong, although not perfect.
PR AUC : 0.307: This measures performance when new construction is relatively rare.
F1 score : 0.456 : This balances finding real construction with avoiding false alarms. The result is moderate: useful for identifying likely areas, but not reliable enough to predict every individual site.
Precision : 0.343 : About 34% of the locations flagged by the model were actually built on. That may sound low, but it is substantially better than selecting locations without the model.
Recall : 0.680 : The model found about 68% of all the places where construction occurred. This is good coverage, although roughly one-third of the real growth was still missed
Base rate : 0.063 : Only 6.3% of the available locations became built during the observed period. This shows why the prediction is difficult: genuine building growth is uncommon compared with all the land that remains empty.
Lift : 5.40× : Locations selected by the model were approximately 5.4 times more likely to experience construction than an average available location. This is a strong and easily understandable sign that the model adds useful information.
Brier score : 0.0477 : This measures how closely the predicted chances matched what actually happened, with lower values being better. The score is reasonably good, but it does not mean every individual probability should be treated as exact.
Interestingly enough distance from existing buildings was the strongest influence. Built-edge adjacency and wider neighborhood density were also important, while immediate local density contributed relatively little. Interesting how the 120m build share almost adds nothing to the final models score.

Below is a visualization of the model output. if you would have run the model on each area of the map. In itself its not very useful, but it still give you an idea of what the model attempted to predict. Light blue is where buildings most likely would be built while darker areas are less likely. As I said before, this in itself is not very useful as no terrain was taken into account not growth rates of any kind) But still pretty to look at.

Step 5: Building the final predictive suitability map
Say that 5 times fast while looking serious I dare you! So our final map of where buildings will most likely will be built is coming together nicely. Mixing the final batch and putting the pie in the oven. We now have a developable surface showing where it’s physically possible to build, a map showing where buildings are likely to be built based on past and existing buildings. Or in other words how much pressure the existing buildings add to where new buildings might be built. And lastly we have the directional preference of the general direction buildings tended to be built in based on historical data.

Combining all of this give you a map that shows where buildings actually might be built. Now you can not just use photoshop and merge all the data and get your final map. No.. (I have tried) you need to predict one cell (a 10×10 meter section) at a time. Then repeat the process over and over and over until the whole map is filled. Lucky for me you can just run this in a for loop and watch the magic happen.
For interest sake below is the actual formula is above and I promise this is the only one you will see in this blog if I can help it.

The suitability score for each candidate cell combines land availability, historically observed development patterns, proximity to existing buildings, and the dominant direction of urban expansion. Developability acts as a spatial constraint, reducing or eliminating the score of cells where construction is unsuitable, including water and already occupied land. The distance, local built share, and neighborhood built share terms are weights learned from the observed change in building footprints between 2016 and 2023, representing how development likelihood varied with distance from existing structures, built density within 120 meters, and wider development intensity within 600 meters. The adjacency term adds a fitted coefficient of 2.0868 when a cell directly touches existing development, reflecting the strong tendency for new construction to extend outward from the existing built edge. These model components are combined exponentially to produce a positive development pressure score. A directional adjustment is then applied using the angle of each cell relative to the existing urban area. The value 45.4° represents the observed dominant growth direction, approximately northeast, while the coefficient 0.4 limits this directional influence to a maximum increase or decrease of 40%. The resulting value is a relative suitability score used to rank eligible cells for development, rather than a direct probability that construction will occur.

And here above you can see the final map being formed. I could have just shown the final map, but seeing how it’s being generated look really cool and I spent more time looking at this than what I would admit.
Step 6. Testing the final suitability map
Great.. now that we have the final map we need to see how good it it.





Step 7 Determine growth rate


Step 8 Future Prediction


2026 ,2036, 2076
ATM BRANCH PREDICTION










