Spatial data comes in various forms. Your data doesn't actually have to contain coordinates to be spatial. It is sufficient if it has a reference to other spatial data, such as a name, an address, or an ID/code.
All you need is a way to match this name to a location.
In this example, the data contains a zip code for the sales amount in the area around our stores. This is a common way to look at sales: you aggregate these numbers by administrative or postal boundaries.
So I have been aggregating the sales numbers for two locations. In the map below, you can see the two locations, and you can see 3 drivetime zones around the locations, giving you an idea of the catchment zones around these locations.
In this article, I will show how you can load this sales data per zip code into MapInfo Pro, map it, and show the sales amount on your map.
Happy #MapInfoMonday!
Accessing Data from CSV Files
Now this type of data comes in various forms: Comma Separated Values, Text/ASCII Files, Excel Files, and others. MapInfo Pro allows you to easily load these files.
In my example, I have a CSV file with the zip codes and the respective sales amounts for these.
As the Files of type, I select Comma delimited CSV (*.csv), and then I select the file and hit the OK button.
Next, I have to configure how to load the CSV file into MapInfo Pro.
Mapping Data against Zip Codes
When you bring in data that doesn't have spatial data directly, but holds a reference to some other data, there are typically two ways you can make this data spatial: Geocode or SQL Join.
In this example, we will be using SQL Join.
As you can see above, I have a table with Zip Codes called Zip_Codes. I will use this to give my sales data a spatial object.
In MapInfo Pro, you can find a few ways to create a spatial join. I'll use the classic SQL Select dialog.
I select the two tables to use, and MapInfo Pro suggests a possible join between these two tables. Make sure to validate this join as it can be off under certain conditions.
I also select the columns I want to include in my query result. In this case, I just select the Postsect or Zip Code column and the column holding the sales amounts.
Finally, I give the query result a new name and uncheck all the options at the bottom of the dialog besides Add results to Current Map Window.
When I run this query, I get the resulting query added to my map, allowing me to see the catchment area for the two locations.
Often, you may want to normalize this data to some degree. That is base it upon the number of people living in each postal area, or by the size of the postal areas.
Let's try to divide the sales amount of each postal area by the area of the postal area.
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------