MapInfo Pro

 View Only

MapInfo Monday: Masking a Map Using a Selected Polygon

  • 1.  MapInfo Monday: Masking a Map Using a Selected Polygon

    Employee
    Posted 01-10-2022 02:57

    Happy #MapInfoMonday,

    One useful way to highlight an area in a map is by toning down the rest of the map. This is exactly what the Mask tool can help you do. With the Mask tool, you can create maps like this where there area outside the planning zones has been toned down.


    The Mask tool is one of the most popular tools in the MapInfo Marketplace. The tool was created by Egge Jan Pollé

    Downloading the Mask tool

    Let's first get the tool downloaded, and then I'll quickly show you have to use the tool.

    From the Home tab, click on MapInfo Marketplace to open up the marketplace. If you aren't logged into your MapInfo Pro account, you will be prompted to do so. This is a free account that gives you access to the MapInfo Marketplace and to the Precisely API for geocoding and drivetime calculations.


    From the Login Page shown above, you can also quickly create your free account if you don't have one.

    Once you are logged into the MapInfo Marketplace, you can browse the list of tools. As we are interested in the Mask tool, click on that tool to go to the main page for the tool.


    To install the tool, click on the button Install Product in the top right side of the page. If you already have the current version of the product, the button will state Reinstall Product.

    MapInfo Pro will download the tool, unzip it into the tool folder and run the application after having installed it.


    You are now ready to use the tool. Also notice, that MapInfo Pro will notify you if there is a new version of the tool available on the MapInfo Marketplace.

    How the Mask tool works

    Before showing you how to use the tool, I wanted to let you in on how it works. The Mask tool add an additional layer to your map window. Into this layer the tool creates a polygon covering the data extent from the table you have selected a record from and then it creates a hole in this polygon using the selected polygon.

    The layer is shown using a translucency settings which makes it possible to partly see through the polygon. And where the hole has been created, you can see straight through. This makes the area under the hole appear clearer where the area around the hole seems toned down.

    The Mask layer is an ordinary MapInfo tab file and you can once the layer has been added to the map, change the position of the layer to control which layers are affected by the mask and which aren't.

    Also notice as labels always are drawn after all other layers have been drawn, they are not affected by the mask. They will appear on top of the mask anyway.

    Using the Mask tool

    It's quite straight forward to use the Mask tool.

    First, you need to select the polygon that covers the area that shouldn't be affected by the mask. In this case, I'm using a planning zone. In the map below, the selected polygon is the darker red area.


    Now click on the Mask button on the MASK tab which will show the Mask dialog.


    In the Mask dialog, you can set the border style of the mask, you can specify the translucency, and you can specify what table to save the mask to.

    Click OK to see the result. Notice that in the map below, I have changed the style of the planning zones to only have a thick purple line and no fill


    You can easily change the translucency if you think it hides too many details in the area surrounding the planning zone. Simply select the mask layer in the Layer List, and use the Layer Translucency slider on the Style tab.


    I hope you have found this article useful.

    What MapBasic tools do you use a lot?



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