                                                                import
Chapter 15 Import and Export

Imported raster information, which includes scanned data, is imported directly
into the current, active map's raster.  Vector information is imported into a
user-designated level of the current, active map and may be moved to the map's
raster with the level_dup or level_icopy commands if desired.  As an example,
one of the more common routes involves importing information scanned by a
Houston Instruments (HI) ScanCad system.  The data is output by the HI system
in a DOS raster format file with a .ras extension.  To move this file into
LTPlus, the user should execute the import command with the ras format type
included as a parameter.  The LTPlus import formats include:

asn

Raster format generated by USFS FASTGRAMS conversion software.

cell

This is a fairly generic format for handling raster, grid-based information.
It is commonly used for importing data from MTHMAP and R2MAP.

cff

Cartographic Feature File is the vector format associated with the base layer
data supplied by the Geometronics Service Center (GSC).
*
dem
*
Digital Elevation Model is a list of elevations and header data as defined
by the U.S. Gelogic Survey

digit.ascii

An ascii vector format used by GRASS (CERL/SCS).

digit.att

An ascii format holding attributes and their locations, used by GRASS
(CERL/SCS).

dlg3

This is a comprehensive vector format developed by the U.S. Geological Survey
and compatible with a variety of external applications, including the ARC/INFO
GIS.

dxf

Rapidly becoming the CAD industry standard, this vector format is most closely
associated with the AutoCad software package.


gis

A cell type format output by ERDAS its .gis file.  When this format is
imported, the entire raster is erased and resized to fit the cell data.  All
vectorized data, attributes and registration are lost.  You should only import
this data into a newly-created map.  This format carries registration, polygon
and attribute information.  Reference the dig format (used with ERDAS).

map

LTPlus internal map files format.

moss

This is a data-intensive vector format which supports the MOSS GIS application.

optr9

A raster format developed to transport digital data generated by the Optronics
scanner at GSC.

ras

A specialized raster format generated by the Houston Instruments ScanCad
system.

rdef2

Raster Data Exchange Format, developed for exchanging raster data among DWRIS,
LIDES and LTPlus.

rstr

A generic, bit-mapped raster format.

rlc

A run-length encoded raster format used by several scanners including the Ideal
Context scanner.

rle1

A one-byte, Run Length Encoded raster format.

scsgef

An SCS format that may consist of three or four files that hold header, segment
coordinate pairs, points, and an optional feature file containing isolated
segments.  The line file is is required for this category of import.  The point
and feature files may be useful as well.  The header data is not currently
used.
*
tan
*
The LTPlus name for a pair of files output by the Tangent scanner.  This 
raster format consists of two files which have the same name with different
extentions.  The .cmd file has header information, and the .img file is a 
bit-mapped raster file.
*
xy
*
The LTPlus name for any user-specified ASCII xy vector format.  This can be 
any file which contains x,y information with optional attribute information.
Each vertex must be on a separate line.  There may (or may not) be a single
header line between vertex lists.  All items must be separated by at least
one blank (if not, they can be inserted using b_edit).
*
---------- 
*
NOTE:  When importing raster or cell files, a duplicate copy of the original
scan or cell file is automatically stored as the braster.  YOU DO NOT HAVE
TO CREATE A BRASTER (brstr_create) MANUALLY.
*
---------- 

import

The import command reads data in various file formats and, depending on the
format, places them on the raster (base level) or at the specified
display/import level (35-95).

VECTOR FILES

Files in vector format imported by the user are put onto an import/display
level specified by the user.  There are 61 of these levels available, numbered
35 - 95.  From there, they can be displayed (graphics), used to modify
raster-based data (level_snap), or duplicated onto the raster itself (level_dup
or level_icopy).  All (and only) import formats which include the l (level)
parameter are of this type. They include:

*        cff    dem     digit.ascii    dlg3      dxf     moss    xy

*  NOTE:  Whenever vector data is imported, it is also displayed on the 
*  screen.  To remove it from the display or make other display changes, use
*  the graphics command.

RASTER AND CELL-BASED FILES

Other file formats include several types of raster and cell-based data.  These
are imported directly onto a new raster and destroy all old data for the map to
which they are imported.  Import formats of this type do not have the l (level)
parameter.  These include:
     
*        cell    gis    optr9    ras    rdef2    rlc    rstr    tan

These types do not have explicit vector or topology information, but do have
relative position information.  In LTPlus, this is handled most efficiently by
sizing a raster exactly to the file so that nothing is lost or distorted.  This
destroys the old raster coordinate system which links all of the old data
together (on that map).  If you want to bring this type of data onto an
existing map, first import it into a blank map, assemble the data, then export
a vector format file (i.e., dlg3 or moss) and import that vector file onto an
import/display level of the intended target map.

*  NOTE:  When you import raster data, it is placed in a raster file which 
*  can be edited AND another copy is also stored as a b-raster to save a
*  copy of the original scan which can be used to check the final output or
*  for other uses.
     

SPECIAL FILES
*
One type of format includes attribute information only (an attribute
string, object type to which it belongs, and location information).  These
include:

         digit.att

*
Another type of special format is the dem format.  This USGS format consists
of header information about the position, data density, and accuracy of the
data, and the main dat portion which consists of lists of elevtions at evenly
spaced positions on a coordinate grid.  Data in this format are imported into
LTPlus as vector points, with elevations as their attributes.  The format is:
*
*        dem
*

Another type of special format is the scsgef format.  The map data is
distributed into three or four separate files.  Only one scsgef file may be
imported at a time!  The coordinates are in lon/lat format, in decimal
degrees.  The files are:

    header - contains name of digitized soil survey, map corner coordinates,
    map scale, etc.  This file is not implemented in LTPlus yet.
     
    line - contains coordinate pairs (lon/lat) of the segments.  Both right and
    left polygons are listed along with their respective attributes.

    point - contains location soil map symbols and/or soil point features.
     
    feature - contains linear features that are not part of polygons.  A
    digitized escarpment is the typical example of a linear feature.  This is
    an optional file!


         import type iname [p1] ... [pn]

    Imports a file in format type at location iname into the currently acquired
    map.  The imported data will be placed on the level specified by the user
    (for vector type files) or replace all map data (for cell and raster type
    files); reference the important notes, above.

NOTE:    Under Xenix, a file may be imported directly from the DOS partition
         (on the C drive) or from a DOS diskette in drives C or B.  The full
         path name, included as a parameter, may include the DOS device
         location (A:, B:, or C:) or the import_path argument in the config
         file may be set to one of the DOS device identifiers (A:, B:, or C:).

IMPORT COMMAND PARAMETERS

Different format types require different optional arguments [p1]....[pn], which
should be included in the indicated sequence following the file name.  The
import command takes different parameters depending on the format to be
imported.  Here are all of the different forms (one per format) with
Options/arguments:
     
*   import asn iname
*   import cell iname n a
*   import cff iname l c lname
*   import dem iname l lname
*   import digit.ascii iname l c lname
*   import digit.att iname c s ac
*   import dlg3 iname l lname
*   import dxf iname l c lname
*   import gis iname a
*   import map iname l lname
*   import moss iname l c otype lname
*   import optr9 iname
*   import ras iname r t
*   import rdef2 iname a
*   import rlc iname r t 
*   import rle1 iname
*   import rstr iname b j
*   import scsgef -ftype iname l lname
*   import tan iname r t
*   import xy iname l c otype ht in v at x1 x2 x3 y1 y2 y3
     
The various parameters displayed in this list are defined as follows:

    a    Attribute code:
         1 =  import objects only
         2 =  import attributes only
         3 =  import both objects and attributes

    ac   Action code (for attributes)
         0 =  Replace all attributes with a single new one 
         1 =  Replace/set 1st attribute, leave others 
         2 =  Replace/set 2nd attribute, leave others 
         3 =  Insert new 1st attrribute, push others up by 1 
         4 =  Prefix 1st existing attribute
         5 =  Suffix 1st existing attribute
         6 =  Add a new (additional) last attribute
*
*   at  item number on the ascii line of the attribute.  (the attribute, if
*       specified, may not contain blanks, (0 = none).
*
    b    Bits-used code (1-255)
         This value specifies the bits of each byte to be taken as raster data.
         To use the low four bits, set this value to 15; to use all eight bits,
         set this value to 255.  In general, the bits used form an 8-bit binary
         integer, less the flag bits used.

    c    Coordinate type code
         0 =  raster pixels
         1 =  lon/lat, ddd/mm/ss.ss
         2 =  utm meters
         3 =  state plane feet
         4 =  digitizer1 coordinates
         5 =  digitizer2 coordinates
         6 =  map inches
         7-9 = reserved
         10-19 = user-defined coordinates
          
    -ftype    type of scsgef file where the type might be:
         g    indicates file named by iname is to be imported as the header
              file
         l    indicates file named by iname is to be imported as the line file
         p    indicates file named by iname is to be imported as the point file
         f    indicates file named by iname is to be imported as the feature
              file
*
*   ht    object header (type of header line for each vector object) type:
*         1 = none, no header lines for vector objects.
*         2 = ONLY header lines containing an xy location (centroid) and an
*             attribute.  NO vertex data.
*         3 = header line containing the attribute and item number (if any).
*         4 = header line containing the attribute (if any), but the item 
*             number is in the vertex line(s). 
*         5 = header line for each object containing the item number (if any),
*             but the attribute is in the vertex line(s).
*         6 = header line for each object, but attribute & item number (if   
*             any) are both in the vertex line(s).
*              
*   in    item number in the file line of the object's item number.
*         Confusing enough for you?  Ok, for example, in moss import/export
*         format the header line for object number 25 might look like this:
*             25    ponderosa_pine                         126
*         the item number of the object is 25 and is the first group of
*         characters on the line.  In this example the item number of the 
*         'item number' (object number) is 1 (the First item on the line).
*
    iname     Import file name
         The iname parameter may be a file name (with or without a complete 
         path), or a directory name.  If iname does not contain the / character,
         it is assumed to be a file name in the default import directory
         (listed in the config file).  If it does contain the / character, it
         is assumed to be a path name.  The path is checked to see if it is a 
         file or a directory.  If it is a file, the file is imported.  If it is
         a directory, the program looks in that directory for a file which has 
         the same name as the map.  This is to allow easy batch importing for a
         list of maps.
     
    j    Ratio of import file ascii lines per one scan line.

    l    Level number of base category
         Each dlg3 file may contain one or more data categories, with each 
         category imported to one, user-designated LTPlus level which lies 
         within the inclusive range of 35 and 95.  It is suggested that an 
         organized pattern of level usage be adopted.  For example, all 
         adjacent map data imported (for edgematching) might be placed on 
         levels 35-38, with the map to the west on level 35, etc.  This allows 
         much more efficient usage and makes it easier to track your data.
     
    lname     Default level name
         This is the name that will be given to the level if the dlg3 file 
         doesn't have a category name.  It will be used to prompt you when 
         you need to select a level later on.

    n    Number of ascii characters per cell in a cell file; normally 1 or 2.
     
    otype     Object type code
         MOSS import/export type files hold only one type of object per file:
            0 = points
            1 = lines
*           2 = polygons   (forces closure when in xy import format)
*        xy (user defined) import allows another type, automatic:
*           3 = auto: (1 vertex=node, 2=seg, 3+=seg[unclosed] or poly[closed]
     
    r    Reduction factor for raster resolution of ras files.
         When raster resolution is reduced, several scan pixels are grouped 
         into one raster pixel in LTPlus.  A 3:1 linear reduction would 
         convert a 3 x 3 block of scan pixels into a single LTPlus raster 
         pixel.  The allowable values are:
            1 = no reduction
            2 = 2:1 linear reduction
            3 = 3:1 linear reduction
            4 = 4:1 linear reduction
            5 = 5:1 linear reduction
            6 = 6:1 linear reduction
         The advantages of reduction are speed in processing, and smaller file
         sizes.  If the scan has much higher resolution than the original 
         data, then reduction should be given serious consideration.

    s    Set number
         Set number of map objects in the current, active map to which to 
         assign the imported attributes.  If an imported attribute location 
         associates it with an object in set s, then the attribute will be 
         assigned.  Otherwise, the attribute will not be assigned.

    t    Fractional threshhold for use with r > 1, above.
         When raster resolution is reduced, several scan pixels are grouped 
         into one raster pixel in LTPlus.  The t value (fractional threshhold)
         allows the user to specify the portion of the original scan which must
         be on to produce an on raster pixel.  If t=.25, then 25% of the 
         original scan pixels in a reduced group would have to be on to get an 
         on LTPlus raster pixel.  The allowable values are between 0.0 and 0.1.
*
*   v   item number on the vector object header line of the number of verticies.
*       (0 = none)
*
*   x1  item number on the ascii line of the x coordinate in units of type c.
*       NOTE if coord type 1 is specified (lat/lon) then x1 specifies where 
*       degrees (or decimal degrees) are located.  IF the degrees/min/sec
*       ARE NOT SEPARATED BY BLANKS (e.g.  45/22/30.0 ) then this item will
*       specify them all (SPECIFY  0 [=none]  for x2 & x3).
*
*   x2  item nuber on the ascii line of min (1/60 units) of x coordinate value
*       in units of type c.  USE THIS ITEM ONLY IF degrees min sec ARE 
*       SEPARATED BY BLANKS.
*
*   x3  item nuber on the ascii line of sec (1/3600 units) of x coordinate value
*       in units of type c.  USE THIS ITEM ONLY IF degrees min sec ARE 
*       SEPARATED BY BLANKS AND SECONDS ARE USED.
*
*   y1  item number on the ascii line of the y coordinate in units of type c.
*       NOTE if coord type 1 is specified (lat/lon) then y1 specifies where 
*       degrees (or decimal degrees) are located.  IF the degrees/min/sec
*       ARE NOT SEPARATED BY BLANKS (e.g.  45/22/30.0 ) then this item will
*       specify them all (SPECIFY  0 [=none]  for y2 & y3).
*
*   y2  item nuber on the ascii line of min (1/60 units) of y coordinate value
*       in units of type c.  USE THIS ITEM ONLY IF degrees min sec ARE 
*       SEPARATED BY BLANKS.
*
*   y3  item nuber on the ascii line of sec (1/3600 units) of y coordinate value
*       in units of type c.  USE THIS ITEM ONLY IF degrees min sec ARE 
*       SEPARATED BY BLANKS AND SECONDS ARE USED.
*
    ___________________________________________________________________________
    Example(s):

    To import moss formatted polygon data, in UTM meters, from a file called
    quill_creek onto level 45 which will be called soils level, enter:
     
         import moss quill_creek 45 2 2 soils level

    To import a ras scan file with a path /u/scans/foggy_dew and reduce the
    resolution by a linear factor of 4 with a threshhold of .25, enter:

         import ras /u/scans/foggy_dew 4 .25
    ___________________________________________________________________________
    See also:

    b_edit, crit_type, coord_type, export, level_clear, level_dup, level_icopy,
    level_snap
    ___________________________________________________________________________
