Help for the CISutil LKI utilities
December 30, 2020

Segment:
 - enter a 4 digit LKI segment number
 - must have been valid at the specified date
 - pressing ENTER while in this field is equivalent to
   clicking the Show button.

[Show] button:

 - click this button to show, for the specified Segment:
    - segment number and descripton,
    - hwy number, 1 or 2-way, direction of measurement, 
    - opposite segment (if there is one), 
    - a list of all the LKI versions which include the
      segment number,
    - Region, District and Area numbers, and Area name
      (according to the SegArea table in the latest LKI 
       version which contains the segment).

Km:
 - enter the km of the LKI location to be transformed.
 
Date: (optional)
 - enter a date in yyyy-mm-dd format.
 - used to determine the LKI version to start transforming from.
 - as of CISutil version 4.5, this date is required only for 
   pre-2005 segment revisions, when segment numbers were not 
   changed when segments were revised.
 - should be an "effective" date, e.g. most new segment numbers
   introduced in the 201307 version of the LKI became effective
   on 2014-01-01.
 - if omitted, the [Show Transformation] uses the last date the
   segment was in effect, or today's date if the segment is still
   in effect.
   
[Lookup a valid date for Segment]  button:   
 - click this button to search the LKI transform data for the last 
   date before the segment was replaced.  If the segment is still 
   valid, the date when the segment number became effective is 
   inserted.

[Get Lat Lon] button
 - after entering Segment, Km and Date, click this button 
   to look up the Latitude and Longitude of the LKI location 
   in the LKI Geometry.  The geometry used mostly from CHRIS, 
   but uses GeoBC LKI geometry where CHRIS geometry is missing
   or inferior.
 - the Latitude and Longitude will be put into the Status/Notes
   field, and put in the Windows clipboard, so you can paste it
   into Google Maps or Earth to map the location.
 - if the segment is of an LKI version other than that of the
   available LKI geometry, it will be transformed to that version 
   for the latlon lookup.
 
Direction:  (optional)
 - if the Segment ever went through a transformation from 1 2-way
   segment to 2 1-way segments, enter a direction N, S, E or W to
   indicate which side of the road to use.
 - if left blank the direction of measurement of the 2-way segment
   will be assumed.
 
# Decimal Places:
 - enter 1 or 2
 - if 1 is entered, the km and all input transformation kms will be
   rounded to 1 decimal place before interpolations are done, and
   the output kms will be rounded to 1 decimal place.
   (This is suitable for mimicking CIS collision location 
   calculations.  But it might produce results 0.1 km different
   from using ndp=2 then rounding the result to 1 decimal place.)

[Show Transformations]  button:

 - transformations are displayed in the Status/Notes box
 - no transformations prior to 1995 are shown.
 - (the transformation output is also written to file
    %temp%\LKItran_Detail.txt)

 - older versions of the specified location are shown on lines 
   labelled with negative numbers,
 - the provided location is on the line labelled "0:"
 - newer versions are on lines labelled with positive numbers
 
 * Note that if line "0:" is the first line of the output, 
   and you specified a date in the Date field, 
   the date output is the the date you specified, not the first 
   date the segment number became effective.  
   If no date was specified, or if the "Lookup..." button was 
   used to get the date, then it is likely to be the LAST date 
   the segment was in effect.

   Examples:  
   1. Given Segment 0992, Km 15.3, Date 2010-02-02

	     Version  Eff Date    Seg    Km
	 -1:                      0990  15.66
	  0: 200907   2009-10-01  0992  15.30
	  1: 201307   2014-01-01  1820  15.20 
	  
     This tells you that:
      - segment number 0992 came into effect on 2009-01-01
      - prior to that the segment was numbered 0990
      - in 2014-01-01 it was renumbered to 1820
    
   2. Given segment 1119, Km 0, date 2009-09-30

	    Version  Eff Date    Seg    Km
	  0:          2009-09-30  1119   0.00
	  1: 200907   2009-10-01  1220   0.00
	  2: 201312   2014-01-01  1221   0.00

      This tells you that seg 1220 replaced 1119 effective 2009-10-01,
      and that 1221 replaced 1220 effective 2014-01-01.
      (See the note above about the date on line 0:)

   3. Given segment 3172, km 1, and no direction:
    
             Version  Eff Date    Seg    Km
          0:          2013-12-19  3172   1.00
          1: 201312   2013-12-20  3130   0.41     split NEPUB

      This tells you that 3172 was split into 2 1-way segments.
      NEPUB means that North, East, Parked, Unspecified and Blank vehicle 
      directions get transformed to seg 3174.

   4. If you add a direction of "S" to example 3:

	     Version  Eff Date    Seg    Km
	  0:          2013-12-19  3172   1.00           S
	  1: 201312   2013-12-20  3131   6.64     split SW

       This tells you that vehicle directions of S an W are transformed 
       onto 1-way segment 3131.

Find Closest Locations to a Lat Lon
-----------------------------------

[Find the Closest Locations]  button:
 - given a Latitude and Longitude near an LKI segment, 
   this function finds the LKI location (segment & km)
   closest to that geographic location.
 - it also displays the distance to the LKI location
   in metres (but not accurate to 1 metre!)
 - if there are multiple LKI segments close by, the
   closest point on each segment will be displayed.
   
LKI version
 - the work is done using the latest LKI version of the 
   available LKI geometry database.
 - the results will be transformed to the specified
   LKI version if necessary.
 - if a version transformation is done, the result
   will be followed by "(trans)".
 - if a resulting location does not exist in the 
   target LKI version, the segment will be displayed
   as "OFF".
   
Range  (...within <range> metres)
 - the process starts by finding all the LKI geometry 
   inflection points which are within approximately this
   distance of the specified Lat-Lon.
 - on straight sections of highway, the inflection point
   separation can be as long as the straight section.

[Seg Km <--> LatLon Conversions in Excel] button:
 - this opens a form titled "LKI to/from LatLon in Excel"
   which allows you to do bulk location type conversions,
   1 or 2 per row, in an Excel worksheet.
 - the same conversion methods are used as described above
   for the single conversions.

[LKI Transforms in Excel] button:
 - this opens a form titled "LKI Version Transforms in Excel"
   which allows you to do bulk LKI version transformations,
   1 or 2 LKI locations per row, in an Excel worksheet.


Data Updates
------------
These LKI utilities use the following LKI-related data files:
  LKI_Transform_Group.csv 
  LKI_Transform_Match.csv
  segallversions.mdb
  CHgeo_LKISegGeometry_Data_yyyymm.mdb
  LKI_Data_*.mdb
    - these must be in the CISutil folder if not
      on the MoTI LAN, and not at Cypher.

After each LKI release, do a CISutil update as described
in the README.TXT file, to ensure you have the latest 
LKI files.