MapInfo Pro

  • 1.  MapInfo Monday: Default Theme for Tables

    Employee
    Posted 11-22-2021 05:22
    Happy #MapInfoMonday!

    Today is a beautiful but rather cold day in Denmark.​ High blue sky with a low-hanging sun. Only one month away from winter solstice where we have the shortest day here in Denmark.

    Anyway back to #MapInfoMonday. Today, I'll show you have you can assign a default theme to your table and so make this theme appear whenever you open the table into a new or existing map window.

    Typically, when you open a table into a map, you may want to change its display to make it look ​more pleasing or fit into the current use for the table. Below, you can see an example where I have opened a table with our socio-demographic data for Canada into a new map and styled it slightly with a style override and labels.

    These settings that I have applied, the style override and the label settings, can only be stored in a workspace.

    The style I have set is the same for all polygons in the layer. For this specific layer, it would however make sense to use some of the attribute information to control the style of the polygons. To do so, I'll add a thematic layer to my map based on the total number of inhabitants in the districts.

    From the Map tab, I select Add Theme, select a Range Theme, and then I select the layer and use an expression to calculate the total population based on the MALE and FEMALE population in each. The dialog Create Thematic Map - Step 3 of 3 looks like the one you can see below.

    I can modify this even further if I want to, and in fact, I probably should have divided the population by the area of each district to calculate the population density instead of the population size. I guess that's for another #MapInfoMonday article.

    My map now looks like this.

    The map now makes more sense as the individual districts are colored by the size of their population.
    I want to create a new map with this data and I, therefore, right-click on the table in the Table List and select Open in a new Map Window.

    Unfortunately, the table is opened into this new map with its default styling from the map file, the style saved to the objects in the table. If I have the table in a map already, I can clone this map to create a new map with the table and the layer settings.

    ​I can also save my thematic to the table and in this way have MapInfo Pro apply the thematic to the layer whenever I add it to a new or an existing map window.

    To do so, I close the new map I just created and go back to the map with the thematic. I open the Modify Thematic Map dialog by clicking on the thumbnail next to the thematic layer in the Layer List.

    In this dialog, I check the option Save as Default Theme View under Associate Theme With Table. I could also have applied this when I created the thematic map.

    When I check this option, MapInfo Pro will save the thematic settings to the metadata of the table. When you now open this table into a map, new or existing, the thematic settings will get applied to the map automatically.

    It doesn't matter if you already have the table open or if you open it directly into a map window.

    Are you already using this method to automatically apply thematic maps to your layers?

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


  • 2.  RE: MapInfo Monday: Default Theme for Tables

    Employee
    Posted 11-23-2021 08:23
    If you want to permanently assign colors, fills, etc., to your thematic objects you can build & run the sample tool HardCodeThematics provided with MapBasic version 19 and 21 under this folder:  \Samples\MAPBASIC\HardCodeThemes

    ------------------------------
    Bill Wemple
    Principal Software Engineer, Quality Management
    Precisely, Inc
    precisely.com
    ------------------------------