|
Object table file
|
Top Previous Next |
|
The object table indicates to IMW when graphics should be drawn. It is a list of condition / graphic associations. For any condition existing in a record, a specific graphic may be drawn. As an example, our sample city may have a field called Accident Severity. We would like to display an injury symbol (red circle) on the diagram of any accident containing an injury, and a fatality symbol (solid red circle) of any accident containing a fatality. For this example, let's assume that the Accident Severity field is represented by the following lookup table:
ACCIDENTSEVERITY 0 No data 1 Property damage only 2 Injury 3 Fatality
We must specify to the program that if Accident Severity contains Injury then the program should draw the red circle; and that if Accident Severity contains Fatalily then it should draw the filled red circle.
Another attribute of each object is where it is placed on the accident. Some graphics should simply be placed in the same area each time (like lighting conditions, because they affect the whole accident). While other graphics are specific to one of the vehicles. (like DUI which applies to the individual vehicles) The coding for this is as follows: If the location value is 1 - 5 then the graphic will be rotated to the same angle as the vehicle described by the location value. (a location value of 1 causes the graphic to attached to vehicle 1) If the value is greater than 5 or equal to 0 then the graphic will be displayed at the angle corresponding to that value as is represented from Appendix O. A value of 90 would cause the graphic to be displayed at 90 degrees every time from the graphics original position. 0 degrees leaves the graphic at it's original position, while 180 degrees moves it to it's opposite position. Please refer to Appendix O for the graphics original positions.
All of this information needs to be stored in a file. That file is the Object Table File. The file to be edited is the .TBS file. When this file is saved, it is compiled automatically to a .TAB file. You can edit this file in the text editor that was provided with Intersection Magic. Select the Utilities, Edit Config Files, Object Table, Edit menu options. Use the new option if no file exists yet. The program will ask for a .TBS file to edit or create. If this is the first installation, there will only be one such file, select it. The current object map will be displayed on the screen in four columns.
The first column contains the field name. The second column contains the value that IMW should look out for. The third column contains the graphic object number or name from the Symbol table (Symbols index). The fourth column contains the location value for that object (the location). Here's how it works:
Lets say that your database has a field called Lighting. Now lets say that this field can contain the values daytime; dawn; dusk; night. This would be represented in a lookup table which would look like this:
LIGHTING 1 Daytime 2 Dawn 3 Dusk 4 Night
Finally, let's say that you would like to display the headlight symbol whenever this field contains the value night. The name for the headlight symbol HEADLIGHT. Since this attribute is not specific to one of the vehicles in the accident, we will not attach it to a specific vehicle. We will set the location to 180 so that it is always placed above the accident graphic. The table entry for this graphic takes one row, and that row looks as follows:
LIGHTING NIGHT HEADLIGHT 180
As mentioned earlier, this is the method of representing ALL of the graphics. The most important graphics are of course, the arrows representing the individual vehicles. If your database does not contain a field which indicates the movement of each vehicle (straight, turning right, turning left, etc.) then this part of the table will be quite simple. In this case, specify that a straight arrow should be displayed for any and all vehicles involved. A clean means of doing this is to examine the direction of travel field for any value. Specify that if the direction of travel of vehicle 1 is N, S, E, W then IMW should draw the STRAIGHT symbol at the angle of vehicle 1.
As an example of this fairly simple specification, lets say that the direction of travel for vehicle 1 is in field VEH 1 DIR.
The entries for the arrow objects for vehicle 1 would look like this:
VEH_1_DIR N STRAIGHT 1 VEH_1_DIR S STRAIGHT 1 VEH_1_DIR E STRAIGHT 1 VEH_1_DIR W STRAIGHT 1
another set of entries would also be required to display vehicle 2.
More than likely, your database contains a field indicating vehicle movement. For example it may contain values for straight; backing; turning left; and so on. If by looking at appendix O we find that a graphic exists to represent a backing arrow, straight, and left turning vehicles. We'll assume that there is a vehicle movement field for vehicle 1 and vehicle 2. We would add the following entries to the table:
VEH_1_MOVEMENT STRAIGHT STRAIGHT 1 VEH_1_MOVEMENT LEFT LEFT_TURN 1 VEH_1_MOVEMENT BACKING BACKING 1 VEH_2_MOVEMENT STRAIGHT STRAIGHT 2 VEH_2_MOVEMENT LEFT LEFT_TURN 2 VEH_2_MOVEMENT BACKING BACKING 2
This part of the table is likely to be quite large, as some states code as many as 20 movement types. The norm is around 10 types. Every type of movement must have a graphic associated with it in order for the accident to be drawn. In addition it is valuable to include a graphic for non existent or bad data. Missing or out-of-range data will be imported into IMW as a 0. (unless you have converted it to some other value) IMW provides an object which is a gray straight arrow. From appendix O we find that it is numbered 162. Two lines such as these will handle bad data for vehicle movement without leaving the graphic incomplete:
VEH_1_MOVEMENT _ UNKNOWN 1 VEH_2_MOVEMENT _ UNKNOWN 2
Since every city and state seems to use different fields and codes, IMW has been designed to handle the variation. This table can be changed anytime. It is not used in the import process, so a new import is not necessary.
A good way of handling the creation of this file is to just specify conditions for the straight, left, and right turning movements for both vehicles. Once that is working, go on to the special symbols. It can be a terrible waste of time to specify all the conditions only to find out that one little thing was wrong and it must be done over again. Save the file. In order to compile it, go to the Utilities / Edit config files / Object table / From ascii menu options. It will ask you for the .TBS file you just created, and the .TAB file you wish to compile to. Keep the prefix the same as the .TBS file to avoid confusion.
More:
|