• No results found

MapBasic Program

In document Mapinfo beginners' manual (Page 34-47)

MapBasic is a programming language that you can use to customize or automate MapInfo Professional. To create MapBasic applications, you need the MapBasic compiler, but it is a separate product and is not discussed here. However, you do not need the MapBasic compiler to run a completed MapBasic

application.

Running a MapBasic Program

To run a MapBasic application:

 Choose Tools > Run MapBasic Program. The Run MapBasic Program dialog box displays.

 Choose a directory where you have saved you MapBasic Program files.

 Choose an application from the list ( MapBasic applications have an .mbx extension)

 Click OK

MapInfo Professional then runs the MapBasic application.

In this document we will see how to work with PIANO, PLOT2GR, MAPINFO2GOOGLE, SYNCWINDOW, and SPIDERGRAPH.

Using PIANO.MBX

Piano is a very helpful tool. With it you can create BTSs as a map layer, which is particularly important when new cells are added or upgraded. Also, with this tool, you can easily see adjacent frequencies, find out BSCs, LAC and carry out simple statistical calculations.

Importing Excel data to Create a Map of Base Stations

 Open the Excel File. Remember to save it as .xls format, otherwise it will not work.

 Select the necessary data and press CTRL + C. Right click on the selected data and from the context menu click Paste Special > Values > OK. Close the file.

 Open MapInfo. In the Quick Start pop-up either press Cancel or choose to Restore Previous Session. File > Open > [open the desired Excel file] make sure Preferred View is set to Current Mapper depending on Step 5. Also check the Create copy in MapInfo format for read/write.

 In the Excel Information dialogue box check Use Row Above Selected Range for Column Titles and click OK.

Press OK. Press OK in the following pop-up dialogue box, if any. This is where you can change the Name of the fields. The purpose of changing the data types is because characters are not recognized as number, and numbers are needed for plotting.

 A .tab file will be created with the same name as that of the original excel file. The data displayed here is of the familiar tabular format. Close the file.

 Open PIANO.MBX using the method as shown above.

 From Query menu, select Create Base Stations. In the following pop-up dialogue box click yes.

 In the Selection of the BTS file .tab dialogue box you have to select the .tab file you had just created. Press Open.

 In the File Name to be Created dialogue box type in the filename you want your new .tab to have.

 In the Select Data for BTS Vectorisation, select Azimuth for Bore. We usually use 0.5 for Length. Click OK.

 In create points window set Longitude for X coordinate and Latitude for Y coordinate. Click on Projection. In the Choose Projection window select WGS84 under Latitude/Longitude category. Press OK, then OK again. You may also wish to change the projection symbol.

Other options in PIANO.MBX

PIANO provides a handful of other options for querying your data. Under frequencies you can see which antennas use the same frequency and also the adjacent frequencies. Other parameters such as HO Relationships, Display BSC, LAC, QoS are also available and the options are fairly descriptive. They all are accessed in more or less the same way as the Frequencies option, as shown below.

 From Query Menu, select Frequencies > New Frequency. You will be prompted to select the graphical data in the form of a .tab file from which you want to access the data. Note that you will only be prompted if you have not yet opened the map. All other subsequent queries will be carried out without it. A window will display, asking you to choose the frequency. After

choosing, Press OK.

The red antennas show the cells using the same frequency, where as the blue and green ones show the adjacent frequencies.

Using Plot2GR

This is a very easy to use application. With this you can plot your thematic maps directly to Google Earth. This is easier to use than PIANO, and the steps involved to actually create a theme based map are also fairly simple. Start up MapInfo Professional and open Plot2GR MapBasic Program as explained above. On the Standard Toolbar, i.e. on the same toolbar as File and Edit, you will see another additional tool named rTools. This provides the menu to access all the options available in this application.

Plot2GR has an assortment of options, and how each one works will be discussed in relation to plotting RxLevel.

Select Profile

In the Active Profile dropdown list you will find various profiles, such RxQual, QoS, MOS etc. Since we will be plotting the RxLev attribute of the drive test, we will select RxLev as the active profile. If you select the Show Configuration on load, then it will enable you to configure the ranges, colors etc of the active profile. If you don’t use this method, you have the option of using Configure Profile for the same purpose.

With this option you can modify the active profile as much as you want. Be wary that some predefined values already exist; therefore you do not always need to change the values. But, you should always check that the ranges fall into the correct categories. After you are done, press OK.

Rename Profile

This is a self explanatory option. What this does is simply change the name of the active profile.

Therefore, if you want the name to change from RxLev to Green-Water, this is the place to do it in. Press OK when you are done.

Plot to GE

Efforts of all the other options cumulate to this. This is the option to finally do the plotting. Clicking on this will bring up the first of two dialogue boxes.

Plot2GE: Table Select is the first dialogue box. This will ask you to select the Log Table from which you want to select your data. In simple terms, these are .tab files. From the dropdown list choose

outdoorMS1 and click OK. This will bring about the second dialogue box.

As you most probably know, most tables have various columns. Therefore, in plot2GE: Column Select, you are prompted to select the column from which to graph your data. Since we are plotting RxLevel, we select the appropriate data set. Press OK.

Now you will be asked to save the kml/kmz file and to rename it. Please note that the application comes with its own set of folders, and therefore the kml/kmz files will be saved in this folder. Type in your desired filename and click save. Navigate to the folder in windows explorer. The icon will be in the form of Google Earth’s icon. Double click on it and it will open in Google Earth.

Sometimes it is desirable to create your own profile or the desired profile may not exist. In that case you need to create your own profile. To achieve this follow the steps:

 Choose an empty profile in Select Profile option.

 Change the name of your profile to your desired one in Plot2GE: Rename Profile.

 Go to Configure Profile to customize the ranges and colors according to your needs. When you have done this, your new profile will be saved automatically so that you can reuse it.

Using MapInfo2Google

This is a handy tool for exporting all the layers you have opened in MapInfo to Google Earth. To do this, run the application as mentioned above. You will see MapInfo2Google tool in the standard toolbar. Click on Mapinfo2Google and then click Convert map window to KML file. When you do this, make sure the map window is not maximized or minimized as it will return an error. Click on Restore Down, which is the button in the middle of Minimize and Close. If no error occurs, you will be asked to save the KML file. Choose your desired directory and the filename and save it. Now go the directory in which you have saved your file and open it. It will open automatically in Google Earth. It is generally a good idea not to plot drive test results using this method as it results in place marks, which do not really convey much information and only works to clutter the Map window.

As you can see this does not at all help, since the lines are extremely thin and pale. To improve this, right click on tabs and click Properties in Places menu on the right pane of Google Earth. You can either select a whole group, a sub-group (folder) or a single element.

In the Google Earth – Edit Folder navigate to Style, Color tab. Click on Share Style if you do not see any options for changing line styles. When you are satisfied with the changes, click OK. Now, you may wish to see the drive test data in the same Google Earth window. (Actually this is the only purpose for this application.) Navigate to the folder where you created the .KML/KMZ file using Plot2GE. Open it. Google Earth is good in a way that it lets you overlay KML images on top of another just as MapInfo lets you place layers on top of another. You can take advantage of this to get the figure as follows. This shows the RxLev.

In the map above, the magenta lines show cells, orange lines show roads and blue, green, yellow and red dots show the RxLevel.

Using SyncWindow

SyncWindow can be considered a very useful tool when you need to create or be presented with multiple windows with the same layers. Without this tool, you need to open up multiple Map Windows and add layers manually. This option is available when you click on the Clone Map Window button. You may want to have multiple Map Windows where each may individually represent RxLevel, RxQual, BCCH for example. To avoid confusion it is advisable to rename your windows. To do that click on the title bar

of the window you want to rename, the click on Rename Current Window button. A dialogue box will appear that will prompt you to input the new name of the window. Again, it is sometimes necessary for you to see more than one window at a time. However, resizing each window becomes tiresome and cumbersome. To avoid this problem, click on Tile Windows button. You may zoom in on to a few data points on a particular window, but this will not automatically make the other tiled windows zoom in also. Clicking on Synchronize Map Windows will bring all the Map Windows to the same zoom level as the current window. A dialogue box pops up which lets you perform this task, as well as

embedding/removing embedded legends for all open windows or only current window. If you click on Create a Symbol on all Cosmetic Layers button, you will be able to place a symbol on the cosmetic layer on all maps by just placing the symbol on the active window. You can create a rectangle or an ellipse in the same manner on the open windows using the respective buttons. Clicking on Clear all Cosmetic Layers will remove all the objects you have placed on the Cosmetic Layer. Please remember that in order to add objects to this layer, you need make it editable and selectable.

You can open this tool as mentioned earlier, but instead of opening in the standard toolbar, will open as a floating toolbar on the right-hand side of MapInfo window.

Using Spider Graph

The Spider Graph tool draws lines between objects in a single table, or the objects from two tables based on a join. It then creates a new table of lines that connect the objects from the original table(s) based on matching column names. By default, the lines are color-coded based on their table of origin. Also by default, the new table includes a distance column that stores the length of each line. This particularly important when you wish to have a visual representation of cells serving mobile stations with respect to geography. From Spider Graph we can analyze dominant cells, overshooting cells and cable swaps. The following steps delineate how Spider Graph is plotted.

 From the Menu bar go to Tools > Tool Manager

 Here you have the option to enable the application just for this work session by checking Loaded, or if you want this application to load automatically whenever you turn on MapInfo check Autoload.

Menu bar, Tools > Spider Graph > Spider Graph. This brings up the Spider Graph window.

 Here you make some choices. Firstly, you choose the source and destination table. It is quite usually a good idea to set your test data as the Destination Table. Secondly, you have to choose the columns (one for each table) that will be used to match the data for creating the graph. Please remember that the data type must be the same, and you can change them using the Table Structure option as discussed above. However, the names of the columns may not be same. On the right hand side of the window you choose which columns you want to include in the resultant table. This section shows all the columns present in both origin and destination tables. Use CTRL + Left Click to choose multiple columns.

Note: You have the option to set the unit of measure and also highlight the options Color Code Result, coloring each line grouped by a common field of color, and Add Line Distance option to include the length line.

 Clicking on Create Lines will open up a window that will prompt you to save the resultant table as a .tab file. Click Save. Your Spider Graph will be shown thereafter.

In document Mapinfo beginners' manual (Page 34-47)

Related documents