Last week, I had an email discussion with @John Ievers from our partner CDR Group.
For a customer, John was looking for a way to calculate Population Circles. These are circles - or in this case buffers - around sites where the population within the circle reaches a specific size.
Even though they are created as buffers in my example, I'll refer to them as circles in this article.
The map below shows Population Circles for some sites around Boston. The population in each circle is around 50,000 people.
As you can see the size of the circle depends on the density of the people living in that area. The denser the population, the smaller the circles.
How would you create these without writing a small application that generates progressively larger circles and stops once the Population Circle reaches your target population?
Happy #MapInfoMonday!
It turned out that John and I had a similar approach in mind:
Creating Circles for Sites
I have several sitea in the area around Boston in the US.
I'll create buffers around these using the Buffer Table control from the Buffer dropdown on the Spatial tab.
Before I go through this process, I make sure that the MapBasic window is open. In this way, the statements used will be captured and I can rerun some of these to create buffers of different sizes easily.
I select my Sites table in the Table Buffer dialog, and leave the Store results in table as <New>.
The process of creating a new table starts by showing the New Table dialog. Here I set it to open the table into my existing map, and to base the new table structure on my Sites table.
In the New Table Structure dialog, I add two columns to the new table: one to hold the distance of the buffers and one that can be updated with the population count.
Now, I could repeat this process again for 1 mile, for 1.5 mile, for 2 miles, and so on up to around 10 miles. That's how large I estimate the circles need to be to hold around 100,000 people in rural areas.
That is however a bit cumbersome, so I will use the MapBasic window instead. The statement that I need has already been captured:
All I need to do is to adjust the Width parameter from 0.5 to 1.5, and the value inserted into the column DistanceMI similarly. Each time, I change the value, I need to place my cursor in the line, and hit the Enter key to execute the statement. This will create a new set of buffers.
I first create all the half-mile values from 1.5 to 9.5. After this I do the whole-mile values from 1 to 10. In this way, I will end up with 20 buffers around each site spanning from 0.5 miles to 10 miles.
In a map, all these Population Circles will look like this:
Calculating Population Within Circles
Next step is to update all these Population Circles with the proportionate population in each.
Of course, you need to have a dataset with population data to do this. I have the Precisely PSTYE™ US dataset that holds geodemographic segmentation data - and a population count based on block groups.
As most datasets with population information is based on polygons, we'll have to calculate the proportionate overlap between the Population Circle and the, in this case, block group. This allows us to estimate how many people live within that overlap and assign that count to the Population Circle.
Luckily, this is what MapInfo Pro is designed to do so it's quite straightforward.
From the Table tab, I click on the Update Column control.
I select to update the Site Buffers table and the Population column. I select to get the value from my PSYTE table called psyte us block.
From the Calculate list, I select Proportion Sum so that I get all the proportionate values summarized for each Population Circle. Remember that one Population Circle can overlap several block groups. Finally, I select to calculate the sum of the column population from the PSYTE dataset.
And before you run this, check the Join condition via the Join... button. You want to make sure that it states that the block groups from the PSYTE dataset should intersect the objects from Site Buffers, the Population Circles.
Filtering Population Circles
The final step is to show only the Population Circles that has the population count that you are looking for.
This can be done in multiple ways in MapInfo Pro. For this example, I'll use the Layer Filter option.
I'm looking for Population Circles for approximately 50,000 people around my sites. As I don't expect the population in the circles to be very precise, I'll filter by 45000 to 55000 in the column population.
Let us check how the map now looks.
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------