Kenex Creating opportunities in the spatial world
   
Kenex Services - Charlene's Tips

Charlene's Tips and Tricks for MapInfo and Discover

Labelling a layer using multiple fields on multiple rows:

Using Expressions to generate custom labels in MapInfo can be time saving for the construction of many of your maps or displays in MapInfo. A common request we get is: How can I display information about a point as a label in two different rows?

One of the easiest ways to achieve this is to use an expression to create you label and the "chr$(10)" function code for a carriage return (new line).

  1. In the Layer Control box, select the layer to be labelled and click Label button or for those of you lucky enough to have EncomDiscover just right-hand-click the layer you want to label in the Enhanced layer control and select Modify Labels....
  2. Click on Expression… from the Label with... drop down box, pick your first column of information and type the following +Chr$(10)+ for the new line and then pick your second column.
  3. Decide on your other settings of text style, position, and label lines. Click Ok.
  4. See my example here for these drill holes in Australia with a hole number, hole length, and the length annotated with text " metres" using this code: Hole_Number +Chr$(10)+Length+" metres"

Using MapInfo's distance calculator:

  1. Add the Distance Calculator from your MapBasic programs by selecting Run MapBasic Program... from the Tools menu and open DistanceCalc.mbx.
  2. From the Tools menu then select Distance Calculator and then Run Distance Calculator to bring up the dialog box shown below.
  3. Select your origin table, ID column, destination table, ID column, distance units and your optionally selected area.
  4. Select Calculate Distance to show preliminary results and Save Results when you're happy with the data in the output window.

Adding incremental numbers to a column in an existing table:

To create incremental numbers all you need to do is run Update Column... from the Table menu and use the "rowid" function in the Value field for the column you wish to update. You will then get a unique value which represents the index number of each row in the table. You can then perform any mathematical or string function on this to create a unique value. An example for creating sample numbers looks like this in the Value field: "SN"+(rowid+10000) The result will fill your column with values like: SN10001, SN10002, SN10003 etc...

Translating a vector object to a new location: [thanks goes to Tim Ashby at Encom for this tip]

This is done using Encom Discovers Transform Objects function.

  1. Select the objects you want to transform in your map window
  2. Open the Object Transformer (Transform Objects...) from the Object Editing options in the Discover menu (see picture below).
  3. Select the amount of rotation, movement, or scaling that your objects need to undergo and fill in the required information for each translation (more about these can be found in your Discover manual). Click Ok.
  4. Just remember that all transformations are relative to a base point and that you can't scale point data. If you want to scale and rotate objects relative to one common point you need to use Discovers Transform Coordinates function.

Listing all the unique values from a data column:

It's often quite handy to have a list of all the unique values from a data column in your spatial database. Consider our example here where Matt was wanting to find all the different report numbers linked to geochemical samples across a region in Queensland. By using the SQL query shown below he was able to produce a table that was list of all the different reports associated with the 100,000 stream sediment samples where he was researching.

He entered in the column "ReportNo" with the unique values he was wanting to find into the Selected Columns section, the table "QLD_StreamSed" with all the data in into the Tables section. The number entered into the Group and Order sections refers to the column in the Selected Columns section. In this case Matt wanted to group by the ReportNo column, column number 1. Matt also wanted to know how many samples were from each report and wanted to order the reports from the most to the least samples. To do this he added a "Count(x)" (the x is a multiply symbol entered from the operators pull down menu) to the Selected Columns section and a "2 desc" in the Order by Columns section. The "2" referred to the second column in the Selected Columns section and the "desc" was used to order the values in a descending order. The result went into a table called "Reports" shown here:

 

Contact Us
E-mail address
info@kenex.co.nz
Ph +64 4 562-6253
Fax +64 4 562-6254

 

 

©  Kenex 2006 | Legal Information | Phone: +64 4 562-6253 | E-mail: info@kenex.co.nz