Crea sito

Prev Up Top Next Contents

4.7 Importing surveys

Therion can import survey centerline data, produces by other programs and use it in the generation of the maps.
therion cannot use survey data written in survex format. Therion survey data format is slightly different from survex and you cannot import raw survex data. You can however import ".3d" data file generated with survex.

4.7.1 source

If you have the survey data in a file for an external survey program (survex, compass, etc.) and want to process them by therion you can create a simple thconfig file that imports the data file. For example
  encoding  utf-8

  # input the various layouts 
  input ../thconfig 

  source
    survey the_cave
      import cave.plt
    endsurvey
  endsource

  export map -output cave.pdf \
    -proj plan \
    -layout-debug station-names \
    -layout base 
The important point is to enclose everything about the cave survey data and drawings between the source - endsource commands.
If the 3D data that are imported are referred to a geographical coordinate system, you can specify it on the import command with the cs option. For example, import cave.plt -cs UTM32. If you do not specify any coordinate system, a local coordinate system is assumed. You cannot mix data in a coordinate system with other data in the local coordinate system.

4.7.2 Names

The command for this is "import". It takes as argument the filename to import and has the following options:
The effect of the "-surveys" option depends of the level at which the "import" command is located in the survey hierarchy. With "-surveys use" therion will try to use existing surveys (and subsurveys) of that level. For example consider the following import of a 3d file with station name "top.middle.sub.1",
  survey top
    import file.3d -surveys use -filter top.
    survey middle
      survey bottom
        ...
      endsurvey bottom
      ...
    endsurvey middle
  endsurvey top
therion will first filter the prefix top, thus leaving the name "middle.sub.1". Next therion will try to use the survey middle, and since there is such a survey at the level of "import", it changes the name to "sub.1@middle". Then it will try for a subsurvey of middle named sub, but it does not find it, so the name stays as it is (if found the name would have become "1@sub.middle").
With the value "create", survey names to fit the names of the stations are created and inserted in the therion hierarchy. For example, with the station name "top.1" therion creates a survey top and refers to the station as "1@top".
With ignore surveys are not created.
The "scrap" command has an option for name prefixes and suffixes, "-station-names prefix suffix". For example "-station-names top. []" says to prefix all the names in the scrap with "top." and to suffix with the empty string. In this case the point option "-name 1" is interpreted as if the name were "top.1".
It is also possible to add suffixes. For example with "-station-names [] @top" the point option "-name 1" gives the name "1@top".
Some remarks.

4.7.3 Importing a .3d file

The following examples has a piece ho centerline in a survex data file, and another piece in a therion file. The configuration file has the command "source global.th", and the file global.th organizes the data. Everything is contained in the survey middle. Therefore the station names from the survex 3d file are filtered out the top. prefix, and the survey hierarchy is used. The survey middle has a subsurvey bottom and includes a scrap file middle.th2. There is an equate command to equate the two stations, sub.2@middle from the 3d survex file and 1@sub.bottom.middle from the therion data file. Finally there are the wall lines "join" commands.
  survey global
    import global.3d -filter top. -surveys use

    survey middle
      survey bottom
        input bottom.th
      endsurvey bottom
      input middle.th2
    endsurvey middle
  
    centerline
      equate 1@sub.bottom.middle sub.2@middle
    endcenterline
  
    join m1_sx@middle:0   b2_sx@bottom.middle:end
    join m1_dx@middle:end b2_dx@bottom.middle:0
  
  endsurvey global

The survex source file, from which the 3d file is generated, is
  *begin top.middle.sub
  * export 2
  ...
  *end top.middle.sub
Notice that the station "2" of this centerline must be referred, at level global, as sub.2@middle because the prefix top. has been dropped, and middle has been used in the survey hierarchy.

The therion survey data file bottom.th is
  survey sub
    centerline
      ...
    endcenterline
  endsurvey
  input global_bottom.th2
Notice that the scrap is inserted at the level {bottom.middle.global} of the survey hierarchy. Therefore the "join" commands refer to the wall lines with the suffix @bottom.middle (the commands are located in the global level). Similarly the station "1" in this centerline is properly referred, at level global, as 1@sub.bottom.middle.

The scrap file bottom.th2 has the form
  scrap scrap1 -projection plan -station-names [] @sub -scale [...]
    ...
    point 419.0 610.0 station -name 1
  endscrap
The option "-station-names" says that the point written with "-name 1" has name 1@sub. As this file is included at level bottom.middle.global, the level global refers to this point as 1@sub.bottom.middle.

The scrap file middle.th2 has the form
  scrap scrap1 -projection plan -station-names sub. [] -scale [...]
    ...
    point 622.0 440.0 station -name 2
  endscrap
In this case the point written with "-name 2" has name sub.2. As this file is included at level middle.global, the level global refers to this point as sub.2@middle.
The data in the map legend might come out incorrect as the ".3d" file refers to the whole cave. Wookey asked how to override the value of the "cavelength" (2006.09.20). S. Mudrak reply
Just add lines like this to your layout:
  code tex-map
    \topoteam{Your team.}
    \cavelength{1000\thinspace{}ft}
    \cavedepth{300\thinspace{}m}
  endcode

At the moment survex does not put the team names in the ".3d" file. Therefore therion cannot include them in the output.
There is also a problem with extended elevation. The therion exteded elevation is not designed to be used with extended 3d files import. You should be able to control the direction of extend in the elevation using the extend switch in a centerline block. In particular you can specify the station form which therion should start the construction of the "extended centerline" (switch extend start followed by the name of the station), and the direction of the extension. For example
  import cave.3d -surveys ignore

  centerline
    extend start 2 # start xelevation from station 2
    extend right 8 # extend right from station 8 
    extend left 12 # extend left from station 12 onward
  endcenterline

4.7.4 Importing a .plt file

If you process your survey data with Compass [12] you can either transform your .dat files in therion .th data files with a simple script, or you can import .plt files in therion.
For example suppose to have the following "example.dat" file (or the corresponding "example.plt" file)
        SURVEY NAME: first.dat
        SURVEY DATE: 7 24 2006  COMMENT:
        SURVEY TEAM: ...
        ...
        FROM  TO  LENGTH BEARING  INC   LEFT  UP    DOWN  RIGHT FLAGS COMMENTS
           1  2   10.00   90.00   0.00  1.00  2.00  0.00  1.00
           2  3   10.00  180.00   0.00  1.00  2.00  0.00  1.00
           3  4   10.00   90.00   0.00  1.00  2.00  0.00  1.00
           4  5   10.00  180.00   0.00  1.00  2.00  0.00  1.00
        ...
You can write a .th data file that imports the .plt file (and inputs the .th2 map file),
   survey example
   import example.plt
   input example.th2
   endsurvey
The station point commands in the map file "example.th2" can refer to the station names in the .plt file as, for instance, "point 593.0 241.0 station -name 4".

4.7.5 The examples

Import 3d file
Import plt file

therion users - Fri Feb 12 06:33:06 2010
Prev Up Top Next Contents

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.