|MapInfo Pro v15.0 - Improve your output with friendly layer names
||MapInfo Pro v15.0 is the first release to introduce a new option to give "friendly names" to your layers. These friendly names are stored in workspaces and are used when PDF output is created.
First, we'll go through the basics and then provide a bit more detailed information.
The basics: How to create a friendly name
Creating a friendly name is very easy. In Layer Control, simply right-click on a layer and choose the Rename command.
As in the example above, you can use this option for thematic layers.
If you save a workspace, the workspace will store and recall any friendly names you have assigned to a layer.
Friendly names can be up to 256 characters long and can include most ASCII characters.
Deleting a friendly name
It is very easy to delete a friendly name. Right-click on the Layer and choose Rename. When a friendly name has been applied you will see a red "X". Click on this to delete the friendly name. The name will revert back to the default for the table.
For some of you reading this, the above may be all you need (or want) to know.
But if you want to explore further the next section will explain how to set a default friendly name that will appear when you open a table.
Embedding friendly names into your tables
Now let's get into something a little bit more advanced. As mentioned above, a workspace will save and recall the friendly names you have assigned to your layers in Layer Control. Perhaps you would like a friendly name to be assigned by default, such that every time you open that table, the friendly name will be used.
The definition of a MapInfo table includes a Description field that can be used for this purpose. There are two ways you can set a default friendly name.
Method 1: Open the TAB description file in a text editor and add in the friendly name.
Description "your friendly name"
In this example, the STATES table is being given a description "US State Boundaries". This will be the friendly name used in Layer control when the table is opened.
Descriptions can be added to the TAB file. The Description will be used as the friendly name.
Method 2: Type the command into the MapBasic window.
Here is the general syntax:
Set table your_table Description "your friendly name"
The example using the STATES table shown above is typed into the MapBasic window as follows:
Set table STATES description "US State Boundaries".
More info about embedding friendly names
There are some nuances here.
- If you type a new description (i.e. friendly name) into the MapBasic window it will take effect immediately if no description has already been assigned to the table.
- If you type a new description into the MapBasic window, it will not take effect immediately if a description/friendly name had already been assigned to the table. The new description is still stored in the table and will take affect the next time a table is opened.
- Where a friendly name is present in the table and an alias name has been assigned in the workspace, the friendly name in the workspace is the one that will take precedence.
- Further to the above, if you delete the friendly name that was assigned in the workspace, it will revert to the friendly name as stored in the description field in the table.
To sum up the above, a friendly name assigned by you in Layer control or that was saved in a workspace has precedence over friendly names that are stored within the table.
What about table alias names?
Experienced users of MapInfo Pro may be aware that MapInfo Pro creates alias names for tables when they are opened. This capability still exists (and is very necessary and important!)
By default when you open a table, the starting point for the table alias name is the same as the file name for the table. However MapInfo Pro table names have a number of restrictions in terms of the allowed characters. For example a MapInfo Pro table name cannot contain spaces, nor can it begin with a number. It can use a few special characters such as a dollar sign but only at the end of the name.
When unsupported characters appear in the original file name, MapInfo Pro replaces them with an underscore ( _ ) character.
If you ever edit workspace files you may recognise this.
Open table "My data" as "My_data" Interactive
The "as My data" is the table Alias name. Alias names have also been used to make easier to understand table names. Here is an example from our StreetPro Sweden data.
Open Table "swedg2" As SE_Major_City Interactive
Another use for alias names is where two different tables with the same name are opened. In this event the second table (and subsequent tables) will be numbered. For example, if you have a table called OCEAN and you open a second with the same name then MapInfo Pro will prompt you to give the second table a different name.
Limitations of Alias names
This alias name capability is limited to names of 31 characters or less. It also has a number of other restrictions such as various characters such as quotes cannot be used and tables names cannot begin with a number.
Friendly names can use most ASCII characters, can include spaces and the name can be up to 256 characters long!
Want to learn more about MapInfo Pro v15.0?
Check out this overview which appeared in the July 2015 issue.
Not using the latest version? Download a free trial.
Visit http://web.pb.com/miprov15 where you can download a free trial of the 32-bit release of MapInfo Pro v15.0.
Or, if you prefer the 64 bit release of v12.5 is also available from the same page. Note that this release does not have the new Friendly names capability in it yet but it does have a new ribbon based user interface with many enhancements. Our next 64 bit release is v15.2 and is scheduled for October 2015. It will contain the new friendly names capability.
You can try both, they can run "side by side".
Article by Tom Probert, Editor of "The MapInfo Professional" journal
When not writing articles for "The MapInfo Professional", Tom enjoys talking to MapInfo Professional users at conferences and events. When not working he likes to see movies with car chases, explosions and kung-fu fighting.