.. _if_leica_gsi: ======================= :mod:`leica_gsi` -- GSI ======================= .. moduleauthor:: Stefano Costa, Damien Gaignon .. versionadded:: 0.4 GEO Serial Interface (GSI) is a very popular data format, used by many Leica total stations (TPS) or Digital Levels (DNA). It is stored as ASCII text, with one line per measurement. In each line, there can be several *blocks* of data, with a blank space as a separation. There are two variants of GSI: - GSI8 - GSI16 but they only differ in the size of a single *block*. GSI is a very rich format, and it can hold both cartesian and polar coordinates with a detailed recording of all commands executed by the device and with explicit indication of the measurement units. GSI variants ============ GSI8 ---- GSI8 has data information recorded in 8 bit words. :: 110001+0000A110 81..00+00005387 82..00-00000992 110002+0000A111 81..00+00007586 82..00-00003031 GSI6 ---- GSI16 has data information recorded in 16 bit words. :: 110001+000000000PNC0055 21.002+0000000013384650 22.002+0000000005371500 110002+000000000PNC0056 21.002+0000000012802530 22.002+0000000005255000 110003+000000000PNC0057 21.002+0000000011222360 22.002+0000000005433800 110004+000000000PNC0058 21.002+0000000010573550 22.002+0000000005817600 110005+000000000PNC0059 21.002+0000000009983610 22.002+0000000005171400 GSI Block Information ===================== Datablock structure ------------------- Each line is a datablock composed in a sequence of data words, ending with a terminator (CR or CR/LF). There is two types of datablocks specified by the first data word : * Block of measurement (beginning usually with 11) * Block of code (beginning usually with 41) TPS --- Data word structure ___________________ Every word starts with two characters specifying the data type within the word. * Pos.1-3: Word Index (WI) * Pos.4-6: Information related to data * Pos.7: Sign * Pos.8-15/8-23: GSI8/16 data * Pos.16/24: Blank (=separating character) +----------+----------------------------------------------+----------------------+ | Position | Explanation | Applicable for | +==========+==============================================+======================+ | 1-3 | Word Index | All words | +----------+----------------------------------------------+----------------------+ | 4 | AUTOMATIC INDEX INFORMATION |br| | All words containing | | | 0: Automatic index OFF |br| | angle information | | | 1: Automatic index OPERATING |br| | | | | 3: Automatic index OPERATING | | +----------+----------------------------------------------+----------------------+ | 5 | INPUT MODE |br| | Measured data | | | 0: Original measured values transferred | | | | from the instrument |br| | | | | 1: Manual input from keyboard |br| | | | | 2: Measured value, Hz-Correction ON |br| | | | | 3: Measured value, Hz-Correction OFF |br| | | | | 4: Result of special function | | +----------+----------------------------------------------+----------------------+ | 6 | UNITS |br| | Measured data | | | 0: Meter (last digit: 1mm) |br| | | | | 1: Feet (last digit: 1/1000ft) |br| | | | | 2: 400 gon |br| | | | | 3: 360° decimal |br| | | | | 4: 360° sexagesimal |br| | | | | 5: 6400 mil |br| | | | | 6: Meter (last digit: 1/10mm) |br| | | | | 7: Feet (last digit: 1/10‘000ft) |br| | | | | 8: Meter (last digit: 1/100mm) | | +----------+----------------------------------------------+----------------------+ | 7 | SIGN |br| | Measured data | | | +: Positive value |br| | | | | -: Negative value |br| | | +----------+----------------------------------------------+----------------------+ | 8-15 | DATA |br| | Measured data | | (8-23) | Data includes a sequence of 8(16) | | | | numerical or alphanumerical characters. |br| | | | | Note that certain data words are allowed | | | | to carry more than 1 value (e.g. PPM/MM). | | | | Those data are automatically transferred | | | | with a sign before each single value. | | +----------+----------------------------------------------+----------------------+ | 16 | SEPARATING CHARACTER |br| | All words | | (24) | _: Blank | | +----------+----------------------------------------------+----------------------+ Word Index __________ +-----+-----------------------------------+----------------------------------+---+---+---+ | WI | FUNCTION | Access/Example | 1 | 2 | 3 | +=====+===================================+==================================+===+===+===+ | 11* | Pointnumber | 11… .+00000H66 |br| | x | x | x | | | | PtNo=“H66“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 12 | Serial number | 12....+00640054 |br| | | x | x | | | | S.No. “640054” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 13 | Instrument type | 13....+00TCR305 |br| | | x | x | | | | Instr. “TCR305” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 16 | Station Pointnumbe | 16....+00000100” |br| | | x | | | | | St.No. “100” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 17 | Date |br| | 17....+08022000 |br| | | x | | | | [DD.MM.YYYY] | “Feb. 8th 2000” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 18 | Year Second |br| | 18....+01130000 | | x | | | | [YY.SS.mSmSmS] | | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 19 | Time |br| | 19....+02081029 |br| | | x | x | | | [MM.DD.hh.mm] | “Feb. 8th ; 10:29” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 21* | Horizontal Angle |br| | 21.102+17920860 |br| | x | x | x | | | Hz | Hz „179.086“ gon | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 22* | Vertical Angle |br| | 22.102+07567500 |br| | x | x | x | | | V | V: „75.675“ gon | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 25* | Horizontal circle difference |br| | | ? | ? | ? | | | Hz0 - Hz | | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 31* | Slope distance | 31..00+00003387 |br| | x | x | x | | | | Sdist: „3.387“ m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 32* | Horizontal distance | 32..00+00003198 |br| | x | x | x | | | | Hdist: „3.198“ m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 33* | Height difference | 33..00+00001119 |br| | x | x | x | | | | Hdiff: „1.119“ m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 41* | Code-Block ID | 41....+00000013 |br| | | x | x | | | | Code: „13“ m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 42* | Information 1 | 42....+000TREES |br| | | x | x | | | | Info1: „TREES“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 43* | Information 2 | 43....+000004.5 |br| | | x | x | | | | Info2: „4.5“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 44* | Information 3 | 44....+00CAT.02 |br| | | x | x | | | | Info3: „CAT.02“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 45* | Information 4 | 45....+000000NN |br| | | x | x | | | | Info4: „NN“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 46* | Information 5 | 46....+000000NN |br| | | x | x | | | | Info5: „NN“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 47* | Information 6 | 47....+000000NN |br| | | x | x | | | | Info6: „NN“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 48* | Information 7 | 48....+000000NN |br| | | x | x | | | | Info7: „NN“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 49* | Information 8 | 49....+000000NN |br| | | x | x | | | | Info8: „NN“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 51* | PPM and Prism constant | 51… .+0220+002 |br| | x | | x | | | | PPM „220“ and Prism const „2“ mm | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 52 | Measurement number | | ? | ? | ? | | | Standard deviation | | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 53 | Signal power | | ? | ? | ? | | | | | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 58* | Prism constant | 58..16+00000020 |br| | x | x | x | | | | Prism „2“ mm | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 59* | PPM | 59..16+02200000 |br| | x | x | x | | | | PPM „220“ | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 71* | Remark1 |br| | 71....+0000REM1 |br| | | | x | | | (or Attribute 1) | “REM1” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 72* | Remark2 |br| | 72....+0000REM2 |br| | | | x | | | (or Attribute 2) | “REM2” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 73* | Remark3 |br| | 73....+0000REM3 |br| | | | x | | | (or Attribute 3) | “REM13” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 74* | Remark4 |br| | 74....+0000REM4 |br| | | | x | | | (or Attribute 4) | “REM4” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 75* | Remark5 |br| | 75....+0000REM5 |br| | | | x | | | (or Attribute 5) | “REM5” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 76* | Remark6 |br| | 76....+0000REM6 |br| | | | x | | | (or Attribute 6) | “REM6” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 77* | Remark7 |br| | 77....+0000REM7 | | | x | | | (or Attribute 7) | “REM7” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 78* | Remark8 |br| | 78....+0000REM8 |br| | | | x | | | (or Attribute 8) | “REM8” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 79* | Remark9 |br| | 79....+0000REM9 |br| | | | x | | | (or Attribute 9) | “REM9” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 81* | Target Easting (E) | 81..00+01999507 |br| | x | x | x | | | | E: “1999.507”m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 82* | Target Northing (N) | 82..00-00213159 |br| | x | x | x | | | | N: “-2139.159”m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 83* | Target Elevation (H) | 83..00+00032881 |br| | x | x | x | | | | H: “32.881”m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 84* | Station Easting (E0) | 84..11+00393700 |br| | x | x | x | | | | E: “393.700”m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 85* | Station Northing (N0) | 85..11+06561220 |br| | x | x | x | | | | N: “6561.220”m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 86* | Station Height (H0) | 86..11+00065618 |br| | x | x | x | | | | H: “65.618”m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 87* | Reflector height (hr) | 87..11+00001700 |br| | x | x | x | | | | hr: “1.700” m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 88* | Instrument height (hi) | 88..11+00001550 |br| | x | x | x | | | | hi: “1.550” m | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 531 | Atmos. correction: |br| | 531.16+10130000 |br| | | x | | | | pressure | “1013” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 538 | Coefficient of refraction | 538.16+00001300 |br| | | x | | | | | 1.300” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 560 | Time: |br| | 560..6+00105018 |br| | | x | | | | [hh.mm.ss] | “10:50:18” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 561 | Date: |br| | 561..6+00020800 |br| | | x | | | | [mm.dd] | “2.8.2000” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 562 | Year: |br| | 562...+00002000 |br| | | x | | | | [yyyy] | year “2000” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 590 | SW-Version: |br| | 590..6+00021000 |br| | | x | | | | Application | “V2.10” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 591 | SW-Version: |br| | 591..6+00020000 |br| | | x | | | | Operating system | “V2.00” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 592 | SW-Version: |br| | 592..6+00010000 |br| | | x | | | | OS interface | “V1.00” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 593 | SW-Version: |br| | 593..6+00022000 |br| | | x | | | | GEOCOM | “V2.20” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 594 | SW-Version: |br| | 594..6+00010000 |br| | | x | | | | Gsi communication | “V1.00” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 595 | SW-Version: |br| | 595..6+00011100 |br| | | x | | | | Edm Device | “V1.11” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 913 | Job | 913...+BLDG.A12 |br| | | x | | | | | “BLDG.A12” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ | 914 | Operator | 914...+0MM-3519 |br| | | x | | | | | “MM-3519” | | | | +-----+-----------------------------------+----------------------------------+---+---+---+ \* implemented WI 1. TPS100 Series: TC403L, TC600, TC800, |br| TC605/L, TC805/L TC905/L 2. TPS300/700 Series: TC302, TC303, TC305, TC307, |br| TCR302, TCR303, TCR305, TCR307, |br| TC702, TC703, TC705, |br| TCR702, TCR703, TCR705, |br| TC(R)702 auto, TC(R)703 auto, TC(R)705 auto 3. TPS1000/1100 Series: TC1100/L, TC1500/L, TC1700/L, TC1800/L, |br| TCM1100/L, TCM1800/L, |br| TCA1100/L, TCA1800/L· TC1101, TC1102, TC1103, TC1105, |br| TCR1101, TCR1102, TCR1103, TCR1105, |br| TCM1101, TCM1102, TCM1103, TCM1105, |br| TCRM1101, TCRM1102, TCRM1103, TCRM1105, |br| TCA1101, TCA1102, TCA1103, TCA1105, |br| TCRA1101, TCRA1102, TCRA1103, TCRA1105 DNA --- Only for DNA03/DNA10 Data word structure ___________________ Every word starts with two characters specifying the data type within the word. * Pos.1-3: Word Index (WI) * Pos.4-6: Information related to data * Pos.7: Sign * Pos.8-15/8-23: GSI8/16 data * Pos.16/24: Blank (=separating character) +----------+--------------------------------------------------------------------+----------------------+ | Position | Explanation | Applicable for | +==========+====================================================================+======================+ | 1-3 | Word Index | All words | +----------+--------------------------------------------------------------------+----------------------+ | 4 | Empty, marked as dot (.) | All words containing | +----------+--------------------------------------------------------------------+----------------------+ | 5 | Information about the measurement and | Measured data | | | earth-curvature correction. |br| | | | | 0 = measured; **without** earth-curvature correction. |br| | | | | 1 = entered manually; **without** earth-curvature correction. |br| | | | | 2 = measured; **with** earth-curvature correction. |br| | | | | 5 = entered manually; **with** earth-curvature correction. | | +----------+--------------------------------------------------------------------+----------------------+ | 6 | UNITS |br| | Measured data | | | 0: Meter (last digit: 1mm) |br| | | | | 1: Feet (last digit: 1/1000ft) |br| | | | | 6: Meter (last digit: 1/10mm) |br| | | | | 7: Feet (last digit: 1/10‘000ft) |br| | | | | 8: Meter (last digit: 1/100mm) | | +----------+--------------------------------------------------------------------+----------------------+ | 7-15 | DATA |br| | Measured data | | (7-23) | Data includes a sequence of 8(16) numerical or | | | | alphanumerical characters. | | +----------+--------------------------------------------------------------------+----------------------+ | 16 | SEPARATING CHARACTER |br| | All words | | (24) | _: Blank | | +----------+--------------------------------------------------------------------+----------------------+ Word Index __________ +-----+---------------------------------------------------------+ | WI | FUNCTION | +=====+=========================================================+ | 11 | PointID | +-----+---------------------------------------------------------+ | 12 | Serial number | +-----+---------------------------------------------------------+ | 13 | Instrument type | +-----+---------------------------------------------------------+ | 17 | Date Year | +-----+---------------------------------------------------------+ | 19 | Day time | +-----+---------------------------------------------------------+ | 32 | Horizontal distance | +-----+---------------------------------------------------------+ | 35 | Setting-out difference | +-----+---------------------------------------------------------+ | 41 | Code-Block ID | +-----+---------------------------------------------------------+ | 42 | Information 1 | +-----+---------------------------------------------------------+ | 43 | Information 2 | +-----+---------------------------------------------------------+ | 44 | Information 3 | +-----+---------------------------------------------------------+ | 45 | Information 4 | +-----+---------------------------------------------------------+ | 46 | Information 5 | +-----+---------------------------------------------------------+ | 47 | Information 6 | +-----+---------------------------------------------------------+ | 48 | Information 7 | +-----+---------------------------------------------------------+ | 49 | Information 8 | +-----+---------------------------------------------------------+ | 71 | Remark | +-----+---------------------------------------------------------+ | 83 | Ground height (starting point height or measured height | +-----+---------------------------------------------------------+ | 95 | Instrument temperature [°C] | +-----+---------------------------------------------------------+ | 330 | Staff reading in "Meas Only" | +-----+---------------------------------------------------------+ | 331 | Staff reading, backsight or B1 | +-----+---------------------------------------------------------+ | 332 | Staff reading, foresight or F1 | +-----+---------------------------------------------------------+ | 333 | Staff reading, intermediate sight | +-----+---------------------------------------------------------+ | 334 | Staff reading, setting-out sight | +-----+---------------------------------------------------------+ | 335 | Staff reading, B2 | +-----+---------------------------------------------------------+ | 336 | Staff reading, F2 | +-----+---------------------------------------------------------+ | 374 | Setting-out difference of height measurements | +-----+---------------------------------------------------------+ | 390 | Count of repeated measurements | +-----+---------------------------------------------------------+ | 391 | Mean mode: Standard deviation of the single measurement | +-----+---------------------------------------------------------+ | 392 | Mean mode: Spread of measurements | +-----+---------------------------------------------------------+ | 560 | Time: [hh.mm.ss] | +-----+---------------------------------------------------------+ | 561 | Date: [mm.dd] | +-----+---------------------------------------------------------+ | 562 | Year: [yyyy] | +-----+---------------------------------------------------------+ | 571 | Station difference | +-----+---------------------------------------------------------+ | 572 | Cumulative station difference | +-----+---------------------------------------------------------+ | 573 | Distance balance | +-----+---------------------------------------------------------+ | 574 | Total distance (=line length) | +-----+---------------------------------------------------------+ | 599 | SoftWare Version | +-----+---------------------------------------------------------+ Units ===== The unit in position 6 of the word is used as following : +----------------------------------+-------------------+-----------+ | Unit | Number of decimal | Exemple | +==================================+===================+===========+ | 0: Meter (last digit: 1mm) | 3 | 12345.678 | +----------------------------------+-------------------+-----------+ | 1: Feet (last digit: 1/1000ft) | 3 | 12345.678 | +----------------------------------+-------------------+-----------+ | 2: 400 gon | 5 | 123.45678 | +----------------------------------+-------------------+-----------+ | 3: 360° decimal | 5 | 123.45678 | +----------------------------------+-------------------+-----------+ | 4: 360° sexagesimal | 5 | 123.45678 | +----------------------------------+-------------------+-----------+ | 5: 6400 mil | 4 | 1234.5678 | +----------------------------------+-------------------+-----------+ | 6: Meter (last digit: 1/10mm) | 4 | 1234.5678 | +----------------------------------+-------------------+-----------+ | 7: Feet (last digit: 1/10‘000ft) | 4 | 1234.5678 | +----------------------------------+-------------------+-----------+ | 8: Meter (last digit: 1/100mm) | 5 | 123.45678 | +----------------------------------+-------------------+-----------+ Default patterns ================ Most of the time, a GSI file is composed of three type of lines: * a station point with WI 11 [, 25], 84, 85, 86 [, 87], 88 * a direct point with WI 11, 81, 82, 83 * a measurement with WI 11, 21, 22, 31 or 32 [, 51], 87 [, 88] [, 81, 82, 83] * a comment with WI 41, [42, 43, 44, 45, 46, 47, 48, 49] WI in [] are optional. Known limitations ================= Support for raw measurements is still incomplete, here is a list of **TODO**: * get coordinates order (NEZ or ENZ) * add missing code for TPS (not with an asterisk on the WI list) * add DNA support * add an option to link comment(s) to either the previous or the next line * add an option to link attribut(s) with his point * add the possibility to customize code * add specific raise functions Acknowledgements ================ Support for this format was added thanks to Anna Hodgkinson and Hannah Petten at the University of Liverpool. Some details of the implementation are based on the SurveyTools QGIS plugin developed by Stefan Ziegler. .. seealso:: `GSI Online for Leica TPS `_ Documentation for GSI from Leica.