P_Default

Top  Previous  Next

The P_Default calculated fields are standard fields used by Crash Magic for analysis. The following is a list of fields used by the P_Default calculated fields, the field data type, and a description of what the field is used for. These fields are expected by Crash Magic. Removing or adding fields to the P_Default calculated fields will cause problems. An expression is created for each field that will tell Crash Magic how the field is to be calculated. Each expression is based on the fields returned from the query assigned to the calculated field.

 

_CaseID(string)

Unique identifier for each collision. This field is required by the program.

Example expression:

AccidentID

In this example the query field AccidentID would be assigned to the _CaseID calculated field.

 

_PrimaryStreet(string)

The primary street that the collision occurred on. A valid expression is required by Intersection studies. This is generally the primary street field name of the Intersection study. Collision data that does not use street and cross street to locate collisions should set this field to a blank string.

 

_CrossStreet(string)

The nearest cross street to the collision. A valid expression is required for use by Intersection studies. This field may be blank if collisions in the database do not have cross street data. This is generally the cross street field name of the Intersection study.  Collision data that does not use street and cross street to locate collisions should set this field to a blank string.

 

_Date(date)

An expression that represents the date the collision occurred. Crash Magic will use this field to find the date a collision occurred.

Example expression:

IF(ISNULL(Accidenttime),BuildDate(Accidentdate,0,0,0),BuildDate(Accidentdate,Accidenttime))

In this example the _Date field is created from a date and time field from the query. If the time field is null a time of  12:00 AM is added to prevent the BuildDate function from creating a null date value for an invalid time. Adding a valid time to the date field is no longer required by the program, but is recommended for display of the field to users. Users accessing this field should be informed that the _Date field can contain the bad time data. A null date will result in null data for the field.

 

_Time(date)

An expression that represents the time the collision occurred. Crash Magic will use this field to find the time a collision occurred.

Example:

If(ISNULL(Accidnetdate),BuildDate(ASDATE("01/01/1900"),Accidenttime),BuildDate(Accidnetdate,Accidenttime))

In this example the _Time field is created from a date and time field from the query. If the date field is null a date of  1/1/1900 is added to prevent the BuildDate function from creating a null time value for an invalid date. If Accidenttime is null the entire field will be null. Adding a valid date to the time field is not required by the program, but is recommended for display of the field to users. Users accessing this field should be informed that the _Time field can contain the bad date. A null time will result in null data for the field.

 

_Veh1Dir(number)

Expression that maps vehicle one direction values to the internal directions stored in the .Master configuration. A valid expression is required by the collision diagrams.

 

Exmaple:

Case( Travel_Dir1, "N", _North, "S", _South, "E", _East, "W", _West, _NoDir ) 

Item

Description

Case

Case Function

Travel_Dir1

Parameter to be examined (Field name from the study query)

N

Possible value in Travel_Dir1

_North

Crash Magic Master .shared value for North

S

Possible value in Travel_Dir1

_South

Crash Magic Master .shared value for South

E

Possible value in Travel_Dir1

_East

Crash Magic Master .shared value for East

W

Possible value in

_West

Crash Magic Master .shared value for West

_NoDir

Crash Magic Master .shared value for unknown direction

 

_Veh2Dir(number)

Expression that maps vehicle two direction values to the internal directions stored in the .Master configuration. A valid expression is required by the collision diagrams.

 

_Veh3Dir(number)

Expression that maps vehicle three direction values to the internal directions stored in the .Master configuration. A valid expression is recommended for the additional vehicle indicator symbol.

 

_DistFromInt(number)

Distance from the collision to the location reference point or nearest cross street. Distance from intersection allows Crash Magic to determine the correct area for collision placement in some diagram schematics. Pd' Programming recommends this value default to 0 if the field is null for correct collision diagram displays.

 

_DirFromInt(number)

Expression that maps direction from the collision to the location reference point or nearest cross street.

 

_IsSideswipe(boolean)

Expression to determine if the collision was a sideswipe. This is used by collision diagram to determine if the vehicle symbols should be placed side by side.

 

_IsRearEnd(boolean)

Expression to determine if a collision was a rear end. This is used by collision diagrams to determine if one vehicle should be placed behind another.

 

_IsFatality(boolean)

Expression to determine if a fatality was caused by the collision.

 

_IsInjury(boolean)

Expression to determine if an injury was caused by the collision.

 

_Veh1AheadRank(Number)

Expression to rank vehicle one's position in a collision diagram based on the vehicle maneuver in a rear end collision. This expression is required by collision diagrams.

 

The following is list of standard ranks based on vehicle movement:

Ahead Rank

Vehicle Movement

100

Backing

90

Parking Maneuver

90

Leaving Parking Position

80

Stopped For Sign/Signal

80

Stopped

75

Legally Parked

75

Illegally Parked

70

Entering Parking Position

65

Slowing/Stopping

60

U Turn

55

Left Turn

55

Left on Red

50

Turning on Red

50

Right Turn

50

Right on Red

50

Other Unsafe Turn

45

Ran off Road Right

45

Ran off Road Left

45

Ran off Road

20

Straight

15

Overtaking/Passing

5

Working on or Pushing Veh

1

Overturn/Rollover

1

Airborne

0

Wrong Way

0

Unknown

0

Unattended

0

Skidding/Control Loss

0

Other

0

Leaving Traffic Lane

0

Leaving Alley/Driveway

0

Jackknife

0

Immersion

0

Fire/Explosion

0

Entering Traffic Lane (merging)

0

Entering Alley/Driveway

0

Driverless Moving Veh

0

Crossing Road

0

Crossed Median

0

Crossed Into Opp Lane

0

Crossed Centerline

0

Changing Lanes

0

Avoiding Veh or Obj

 

 

_Veh2AheadRank(Number)

Expression to rank vehicle two's position in a collision diagram based on the vehicle maneuver in a rear end collision. This expression is required by collision diagrams.

 

_Veh3AheadRank(Number)

Expression to rank vehicle three's position in a collision diagram based on the vehicle maneuver in a rear end collision.

 

_Veh1RightRank(Number)

Expression to rank vehicle one's position in a collision diagram based on the vehicle maneuver in a sideswipe collision.

 

_Veh2RightRank(Number)

Expression to rank vehicle Two's position in a collision diagram based on the vehicle maneuver in a sideswipe collision.

 

_Veh3RightRank(Number)

Expression to rank vehicle Three's position in a collision diagram based on the vehicle maneuver in a sideswipe collision.

 

_NorthOfInt(boolean)

This expression is used to determine if a collision was North of an intersection.

 

_SouthOfInt(boolean)

This expression is used to determine if a collision was South of an intersection.

 

_EastOfInt(boolean)

This expression is used to determine if a collision was East of an intersection.

 

_WestOfInt(boolean)

This expression is used to determine if a collision was West of an intersection.

 

_NBArriving(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by all standard collision diagrams that are included in the .master shared user. The default expression is: ( AllMatch( _North, _Veh1Dir, _Veh2Dir ) .OR. SetMatch( _North, _NoDir, _Veh1Dir, _Veh2Dir )) .AND. ( _DirFromInt .NE. _North )

 

_NBDeparting(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by all standard collision diagrams that are included in the .master shared user. The default expression is: ( AllMatch( _North, _Veh1Dir, _Veh2Dir ) .OR. SetMatch( _North, _NoDir, _Veh1Dir, _Veh2Dir )) .AND. ( _DirFromInt = _North )

 

_SBArriving(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by all standard collision diagrams that are included in the .master shared user.  The default expression is: ( AllMatch( _South, _Veh1Dir, _Veh2Dir ) .OR. SetMatch( _South, _NoDir, _Veh1Dir, _Veh2Dir )) .AND. ( _DirFromInt .NE. _South )

 

_SBDeparting(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by all standard collision diagrams that are included in the .master shared user. The default expression is: ( AllMatch( _South, _Veh1Dir, _Veh2Dir ) .OR. SetMatch( _South, _NoDir, _Veh1Dir, _Veh2Dir )) .AND. ( _DirFromInt = _South )

 

_EBArriving(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by all standard collision diagrams that are included in the .master shared user.  The default expression is: ( AllMatch( _East, _Veh1Dir, _Veh2Dir ) .OR. SetMatch( _East, _NoDir, _Veh1Dir, _Veh2Dir )) .AND. ( _DirFromInt .NE. _East )

 

_EBDeparting(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by all standard collision diagrams that are included in the .master shared user.  The default expression is: ( AllMatch( _East, _Veh1Dir, _Veh2Dir ) .OR. SetMatch( _East, _NoDir, _Veh1Dir, _Veh2Dir )) .AND. ( _DirFromInt = _East )

 

_WBArriving(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by all standard collision diagrams that are included in the .master shared user.  The default expression is: ( AllMatch( _West, _Veh1Dir, _Veh2Dir ) .OR. SetMatch( _West, _NoDir, _Veh1Dir, _Veh2Dir )) .AND. ( _DirFromInt .NE. _West )

 

_WBDeparting(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by all standard collision diagrams that are included in the .master shared user.  The default expression is: ( AllMatch( _West, _Veh1Dir, _Veh2Dir ) .OR. SetMatch( _West, _NoDir, _Veh1Dir, _Veh2Dir )) .AND. ( _DirFromInt .EQ. _West ) 

 

_NEBArriving(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by diagrams that support non-cardinal directions. The vast majority of collision data does not support non-cardinal directions, and in most cases is set to false.

 

_NEBDeparting(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by diagrams that support non-cardinal directions. The vast majority of collision data does not support non-cardinal directions, and in most cases is set to false.

 

_NWBArriving(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by diagrams that support non-cardinal directions. The vast majority of collision data does not support non-cardinal directions, and in most cases is set to false.

 

_NWBDeparting(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by diagrams that support non-cardinal directions. The vast majority of collision data does not support non-cardinal directions, and in most cases is set to false.

 

_SEBArriving(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by diagrams that support non-cardinal directions. The vast majority of collision data does not support non-cardinal directions, and in most cases is set to false.

 

_SEBDeparting(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by diagrams that support non-cardinal directions. The vast majority of collision data does not support non-cardinal directions, and in most cases is set to false.

 

_SWBArriving(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by diagrams that support non-cardinal directions. The vast majority of collision data does not support non-cardinal directions, and in most cases is set to false.

 

_SWBDeparting(boolean)

This expression is used by collision diagrams to determine placement of collisions within a diagram schematic. This field is required by diagrams that support non-cardinal directions. The vast majority of collision data does not support non-cardinal directions, and in most cases is set to false.

 

 

_UniqueFields(string)

A string expression that is used to return parameters to the ClickOn query. This field is required for the ClickOn report in collision diagrams. The expression built from the _UniqeFields is placed in a diagram for each collision. This allows the correct parameters to be passed to crash Magic from collision diagrams when a collision is selected.

 

The Format is <Parameter>:<Datatype>=  <Expression>[;<Parameter>:<Datatype>=  <Expression>][...]

Parameter is the parameter required by the ClickOn query, Datatype is the datatype of the parameter required by the ClickOn query, and Expression is the

 

Example expression:

"CRASH_NUM:integer=" + String(CASE_NUM,0) + ";CRASH_DATE:Date=" + CRASH_DATE 

Parameter

Description

CRASH_NUM

The name of a parameter that will be used by the ClickOn query.

:integer

This parameter is the datatype required by the ClickOn query. The result of the _UniqeFields expression are passed as string values, and this parameter tells Crash Magic what the datatype should be converted to for use in the ClickOn.

=

Used to set the parameter valuein the diagram.

+

This operator is used to join the strings together.

String(CASE_NUM,0)

This is the actual value that will be passed to the ClickOn query. In this example CASE_NUM is an integer field in the collision database. The string function is used to convert the integer value to a string to concatenate the string values that are embedded in the collision diagram.

;

This value will separate the parameters being passed when the field is inserted into the diagram.

CRASH_DATE

The name of another parameter that will be used by the ClickOn query.

:DATE

This parameter is the datatype required by the ClickOn query. The result of the _UniqeFields expression are passed as string values, and this parameter tells Crash Magic what the datatype should be converted to for use in the ClickOn.

CRASH_DATE

This is the actual value that will be passed to the ClickOn query. No explicit conversion is required.

Result from the following expression with a value of 503871 for CRASH_NUM and a CRASH_DATE of 01/01/2005 return the following: CRASH_NUM:integer=503871;CRASH_DATE:Date=01/01/2005

 

_Veh1DirIsVeh2Dir(boolean)

Expression to determine if vehicle one's direction of travel should be the same as vehicle two's direction of travel.

 

_Veh2DirIsVeh1Dir(boolean)

Expression to determine if vehicle two's direction of travel should be the same as vehicle one's direction of travel.

 

_Milepost(Number)

Expression to determine the mile post that a collision occurred at. This is used by milepost corridor schematics to place collisions in the correct schematic mile. This should be set to zero if the collision data does not contain mile post data.

 

_BlockAddress(Number)

Expression to determine the block address of a collision. This is used by address corridor schematics to place collisions in the correct schematic block. This should be set to zero if the collision data does not contain an block address data.