MapInfo Pro

 View Only

MapInfo Monday: Mapping Data with a Zip Code

  • 1.  MapInfo Monday: Mapping Data with a Zip Code

    Employee
    Posted yesterday

    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.

    image
    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.

    image
    Next, I have to configure how to load the CSV file into MapInfo Pro.
    image
    I select the correct Delimiter, the File Character Set, and if the first line contains column titles, which it does fr my file. I click the OK Button to load the data into MapInfo Pro.
    Below, you can see the sales data in a browser window to the left of the map.
    image
    That's the first step: bringing the data into MapInfo Pro.
    Now, this step would be similar if the data were stored in an Excel file or another format. There is even another way to bring in CSV files 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.

    image
    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.
    image
    To quickly see the zip codes with high or low sales, I use the Quick Ranged Theme from the context menu of the layer to add a theme based on the sales. This feature can be found in the WindowHelper tool in the MapInfo Marketplace.
    image
    I only have to pick the column to base the theme on and the color range from the Select Color Range list.
    image
    The resulting map of the sales amount across the zip code areas.
    image
    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.
    image
    The resulting map shows how this change influences the thematic map.
    image
    In this case, using the area for normalizing the sales amount isn't the best option. It would have been better to use the number of people living in each postal area.
    Hopefully, this gave you a good idea of how easy it is to bring in data to MapInfo Pro, join it with a spatial dataset, and in this way being able to show data on the map that doesn't hold spatial data itself.


    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------