1) A vector polygon data layer representing the towns in the region.
2) The associated towns database contains attribute fields for total population (people) and area of each town (square kilometers).
3) We have the coordinates of the nearest existing animal hospitals and of our proposed site. We obtained these coordinates by digitizing from a map.
4) We know that, on average for this region, there is one pet for every 17.25 people.
5) For the purpose of our analysis, we will assume that people will take their pets to the closest animal hospital when emergency treatment or routine veterinary activities, such as vaccinations, are necessary.
We will perform our analysis using Idrisi, a raster GIS. We start by creating a blank raster layer. All of the raster steps in the analysis will use raster layers which are identical to this one with respect to spatial extent, pixel size, number of rows and columns, projection, etc. We will use a Universal Transverse Mercator (UTM) grid referencing system and ground units of meters. Based on the extent of the study area 47.4 KM East/West and 40.2 KM North/South we decide on a raster cell size of 50 meters, which will provide sufficient detail for our analysis while maintaining manageable sizes of the data files as we conduct our analysis.
Next we rasterize the towns vector layer into a blank raster. Each pixel within a town takes on an attribute value equal to the value of USER_ID for that town in our database.
This image shows the towns layer with vector town outlines superimposed as well as the locations of the existing and proposed animal hospital facilities. The attribute values in this raster layer range from 1 to 46. Every pixel in the town at the upper right corner of this image has a value of 10, which is the USER_ID of this town in our attribute table above. As can be seen in the table, this town, which extends beyond the edge of our study area, has a population of 5516 people and an area of 40.01531 square kilometers.
We can break down our analysis into two sub-questions:
1) What portion of the study area satisfies the condition that the proposed animal hospital is the closest available hospital?
2) How many pets are located in that portion of the study area? We know that in this area there is one pet for every 17.25 people, so we could estimate the number of pets if we could estimate the number of people who live in this area.
1) We will solve the first question first. While this part of the analysis demonstrates distance and allocation techniques more than map algebra techniques, it is included to clarify the context and interrelation between GIS procedures necessary for a "typical" GIS analysis.
We know the locations from which distance needs to be considered. They are the locations of our existing and proposed animal hospitals (target points). We create a vector point file using our animal hospital coordinates and giving each of the five location points a unique numeric ID. We will use ID's from one to five. (It would do just as well to use 6,7,8,9, and 10 as IDs; it doesn't matter as long as we keep track of which site has what ID.)
We create a blank raster which matches the characteristics of the raster layer for our study area. The blank raster (created in Idrisi using the INITIAL module) contains an attribute value of zero for every pixel. We now rasterize our five animal hospital locations (four existing and one proposed) into the blank raster. Now every pixel in the raster has an attribute value of zero EXCEPT for the five pixels at the locations of our animal hospitals (which are called Happy Pets, Fido's Friend, Proposed Animal Hospital Site, Kitten's Comfort, and Animal Haven, respectively). Those five pixels each have a value of 1, 2, 3, 4, or 5, corresponding to the IDs we chose for our animal hospital sites. The pixel at the Happy Pets location has an attribute value of 1. The pixel at the location of Fido's Friend has a pixel value of 2 and so forth.
We first create a distance image in which each pixel in the raster is given an attribute value which is the pixel's distance from the closest animal hospital. In Idrisi this is accomplished using the DISTANCE module. By running DISTANCE on a raster containing the five animal hospital locations, the following raster data layer is produced:
Given a distance image such as this one as input, the Idrisi module ALLOCATE will allocate each pixel in the input to the nearest target point. ALLOCATE uses the blank raster containing only our animal hospital locations (the target points) with unique IDs to determine what features to allocate to. ALLOCATE produces an image like this (the target points and labels have been superimposed for reference):
At this point in our procedure we have the answer to our first question. The blue area in the allocation data layer above is the area for which our proposed facility will be the closest animal hospital.
Now we can proceed to answer the second question. How many people live in the area which is colored blue in the allocation image? Now we undertake some true map algebra procedures.
Our town database has attribute fields for population and area of each town. With this information to work with, we can determine the average population densities by town across the study area. From this we can determine the total number of people, and, by our known people-to-pets ratio of 17.25, the number of pets who live in the area which will supply customers for our proposed animal hospital (this is the blue area on the allocation image above).
We can proceed with the analysis this way. Our database, or attribute table is linked to our data layer based on the USER_ID field. We can therefore ASSIGN the population values (TOWN_POP) from the database to the towns raster layer. This produces an image in which each pixel has value equal to the whole town's population; every pixel in the town has that value. The resulting data layer looks like this:
In this population data layer, for example, every pixel in the dark blue area at the upper right corner of the image has the value 5516, which is the total number of people that live in that town. It is not important that only a portion of the town is represented; we still assign to every pixel in the portion of the town within our study area the population of the entire town. We will account for this fact in an upcoming step.
Next, we ASSIGN the values from the TOWN_AREA field of the attribute table to create a new raster data layer in which the attribute value of each pixel is equal to the area of the town. For example, every pixel in the (pinkish purple) town in the upper right corner of the raster has an attribute value of 40.01531, which is the area of that town expressed in square kilometers. Again, each pixel is assigned the value of the entire area of the town, even though the whole town is not contained within our study area.
We next create a raster layer which shows the number of people per square kilometer for each town. This is done by performing an OVERLAY-DIVIDE operation. We divide the population per town data layer described above by the area per town layer we just created. This produces the following data layer.
We divided people/town by square kilometers/town to produce a data layer with attribute values of people per square kilometer. In this data layer, every pixel in the rose-colored town at the upper right corner has an attribute value of 137.8472 people per square kilometer (which is also the result of dividing the population and area attributes directly in our attribute table. Recall that this is the town with USER_ID = 10 in the attribute table above.)
From this we just produced a population density data layer which has attribute values in units of people per square kilometer. For the next step in our analysis, we want to convert that to people per pixel. We have 50M by 50M cells and there are 400 such cells in a square kilometer. If we divide (the attribute values in) the population density data layer in units of people/square kilometer by 400 cells/square kilometer, we will produce a raster layer in units of people per pixel:
In this case every pixel in the rose-colored town at the upper right corner of the image has a value of 0.3446, representing the number of people living in that pixel.
The two steps we just completed, producing a population per area by town map and producing a population per pixel map were based on whole-town areas and populations. The attribute values within each town were uniform. If we were to enlarge our study area to include the entire area of a town that is only partially included. We would find that the pixels in the entire town would be the same as those pixel values in the portion of the image in our present analysis. It is in the next step where we take into account that we are only considering the portion of each town that is contained within the study area.
Our analysis is almost completed. All we have to do now is add up the number of people per pixel (depicted in the data layer we just created) for all of the pixels in the customer supply area of our proposed animal hospital. The allocation raster we created above indicates exactly which pixels those are. We use the EXTRACT module in Idrisi to add the pixel values in the people-per-pixel image for each of our animal hospital supply areas. We tell EXTRACT to use the allocation image prepared above to define the areas over which our mathematical analysis, in this case summation, will take place. This is called the Feature Definition Image and it shows 5 areas; our study area is divided into the 5 regions which supply the respective existing/proposed animal hospitals. The Image To Be Processed is the population-per-pixel image. We wish to add up all of the population-per-pixel values within each of our five areas to estimate the total number of people in the supply area for each animal hospital. If we run EXTRACT and specify that we wish to have a table of the results, this is what is produced:
Based on the assumptions we made (e.g., population is distributed uniformly within the area of each town), we estimate that there are 81,797 people for whom the proposed animal hospital site will be the closest animal hospital facility. In fact, the analysis suggests that there are probably more people, because the blue area allocated to our proposed site appears to extend beyond the southern limit of our study area (assuming north is toward the top in these examples). Based on our demographic statistic for our study area that there tends to be one pet for every 17.25 people, we estimate that the total number of pets for which the proposed facility will be the closest animal hospital is 81797/17.25, which equals 4,741 pets. This exceeds the 3,000-pet minimum that we needed to justify a new animal hospital at the proposed site.
There are many ways we could improve the accuracy of this analysis. For example, if we had information about how population is distributed within town boundaries, perhaps we could make a more accurate population density map. We assumed that people will take their pet to the animal hospital that is physically the closest facility. In fact, people may take their pet to the facility that they can reach most quickly. If we had a streets and roads data layer we could use cost-distance modelling or network analysis to create a travel time map. We could then allocate the population within our study region based on the shortest travel time rather than the shortest distance.