MapInfo Pro

 View Only
  • 1.  Place coordinates in mask outside of map frame

    Posted 01-31-2023 22:05
    When printing a map with the old mapinfo (with discover) there was a check box to 'place coordinates in a mask outside of map frame'. Is it possible to place the geographic coordinates in this outside mask with Mapinfo 17.0.4?

    ------------------------------
    Cornell McDowell
    Cornell McDowell
    ------------------------------


  • 2.  RE: Place coordinates in mask outside of map frame

    Employee
    Posted 02-01-2023 06:28
      |   view attached
    Hi Cornell

    Some years back I did a hack via a workspace to create this. I have now reproduced this in a small application that adds a button to the Map tab.
    I have compiled it with MapBasic 17.0.3 so it should work in your MapInfo Pro too.

    Prerequisites:
    1. A table called Grid holding grid lines across the area of your map. The grid lines can also cover the entire country/World. The tools will cut them for the current extent of the map.
    2. A column in the Grid table with the label you want to show. This isn't part of the tool. You configure the label/label expression yourself.
    3. A map window where you want to have a border grid created.

    Here are the steps I did.

    1. I used GridMaker to create grid lines for my area of interest
    2. I added an additional column called Label and used an expression to update this with the text I wanted to use as my label:
    Update BorderGrid
      Set Label = FormatNumber$(Val(DMS) / 1000) + " m " + Right$(DMS, 1)​
    For the lines where the coordinate is dividable by 100,000, I kept the full coordinate value, say 6,100,000 and 500,000. The other just shows the coordinate divided by 1,000, such as  510 and 6,150 etc.

    3. I unzipped the attached file and loaded the MBX into MapInfo Pro
    4. I zoomed into the area of interest and pushed the Border Grid button on the Map tab (it's at the far right end)
    5. Once the tool had finished its job, I turned on labels for the BorderGrid layer and changed the expression to the Label column.

    And the result looks like this:

    The attached zip file also comes with the source code.
    The two tables, BorderGrid and Border are created in the temp folder and are marked so that don't get persisted in workspaces.
    The width of the border is currently set to 2% of the map width

    If you rerun the Create Border Grid, the two tables will be kept open and emptied before the new lines/borders are inserted. In this way, it's easy to rerun and keep the layer and label settings for the layers.

    Let me know if this works for you

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

    Attachment(s)

    zip
    BorderGridTool.zip   4 KB 1 version


  • 3.  RE: Place coordinates in mask outside of map frame

    Employee
    Posted 02-02-2023 08:02
      |   view attached
    Hi

    I just ran my tool again and boom! It seemed that I hadn't tested it after recompiling for v17.0.
    I have done that now.

    I also improved the performance a lot so it works far better now.

    And I tested it to see if it works in a map embedded in the layout. It does. You just need to activate that map before running the tool.

    I have attached a new version of the tool and sourcecode.

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

    Attachment(s)

    zip
    BorderGridTool.zip   4 KB 1 version


  • 4.  RE: Place coordinates in mask outside of map frame

    Posted 02-02-2023 10:02
    Thank you Peter!
     I have not had a chance to run the tool yet due to a heavy workload, but I will do so in the next few days. I greatly appreciate your response to my inquiry.
    Cornell

    ------------------------------
    Cornell McDowell
    Cornell McDowell
    ------------------------------