MapInfo Pro

 View Only

MapInfo Monday: Preparing Telco Site Tables 2

  • 1.  MapInfo Monday: Preparing Telco Site Tables 2

    Employee
    Posted 03-31-2025 04:56
      |   view attached

    Happy #MapInfoMonday!

    This is a follow-up article to last week's post on preparing tables for Telco Site analysis. Last week, I showed how you can use a script in the SQL Window to load an Excel file with data about telco sites automatically and create sectors from this file.

    I also referred to some additional ideas that came up in my call with AT&T when showing this process.

    So today, I wanted to improve the initial script to also create an alternative visualization of the antenna information.

    There is often more than a single antenna mounted on the telco towers. They often point in different directions, but you can also have multiple antennas pointing in the same direction. We even saw this in last week's article, where I offset the antennas based on their Antenna Group ID.

    But sometimes, this isn't enough. As you can see in the example below, one of the sites I clicked on has many antennas of different types pointing in the same direction. All the 16 antennas listed point in the same direction.

    So how do you display all these on a map? AT&T already had the answer to this: Instead of showing each antenna as a circular sector, they were showing them as doughnut sectors. That's rings around the site pointing in the direction of the antenna.
    The trick is to find a value that can be used to ensure that no rings overlap.
    In the article last week, we used an existing value to offset the sectors away from the site. We'll use a similar approach this time. The value you will use depends on the data that you have available with your site data.

    The MapBasic Script

    Let me walk you through the changes I made to the script from last week. You can find the script attached to this article.
    At the top of the script, I define two new variables, and I define a value for the width of the rings. I base this width on the existing radius value, divide it with the maximum value from the column I'm using to offset the rings, and multiply it by 5 to give it a decent width.

    Dim sTabSector2 As String
    Dim fRadiusAnnulus As Float

    fRadius = 200
    fRadiusAnnulus = (fRadius / 53) * 5

    The second change is creating a new table and converting the existing points to rings. I also specify a style for the rings so that they stand out from the other sectors.

    sTabFile = Left$(sTabFileSite, Len(sTabFileSite) - 4) + " Sectors2.TAB"
    sTabSector2 = PathToTableName$(sTabFile)

    Commit Table sTabSite As sTabFile
    Open Table sTabFile

    Set Style Brush (2, 16711935, 0)
    Set Style BorderPen MakePen (1, 2, 0) 
    Update sTabSector2
      Set Obj = DTCreateAnnulusSector(OBJ, DTNorth2MathAngle(Azimuth)
                   , (AntennaNearUnitId - 1) * fRadiusAnnulus
                   , AntennaNearUnitID * fRadiusAnnulus
                   , Horizontal_Beam_Width, 36, 2)
    Commit Table sTabSector2

    The function DTCreateAnnulusSector used above is from DrawTools. This means that DrawTools must be running for the script to work. Annulus is another word for a doughnut or ring. It takes the same parameters as the function DTCreateCircularSector that I used in last week's article. But it also takes an additional parameter: The width of the ring or annulus.

    Finally, I also changed the Map From statement to include the new table.

    Map From sTabSite, sTabSector2, sTabSector
    Set Map Layer sTabSite 
       Label With iuantAntennaModelNumber+ " " + Azimuth+Chr$(176)
                  + " W:" + Horizontal_Beam_Width+Chr$(176)
                  + " Group: " + AntennaUnitGroupId 
                  + " Tilt: " + electricalAntennaTilt+Chr$(176)

    Below you can see the resulting rings in a map with the sectors. The values I'm using to offset the rings are not continuous, and therefore, you can see that the rings appear in groups with spaces in between. The position for the same value will, however, be the same across the sites, so comparing these between sites is possible.

    I hope you find this useful.


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

    Attachment(s)