RiskWare  On-line Reference Manual

Release Level 1.9
Release Date 2000 06


Revision Level 1.0




GIS data import

GISfilter4, Nodatafilter4, and Cellfilter4 Input and Structures

This document describes the data structures used in XENVIS and the procedures to add, update, or remove these data sets.

Vector Maps

For importing vector data, gisfilter4 converts GRASS coverages into ESS internal formats.

gisfilter4 automatically generates new overlays for XENVIS's GIS from Arc/Info export or GRASS output files. The filter will create an entry into the overlay selector, display and extend the legend upon selection, provide for automatic zooming, and access to the overlay editor, etc.

The command to filter the data is gisfilter4 config_file (see the description below of the config\file). If no error message occurs, a new overlay will be created in the directory specified in the config_file.

To include this new overlay into the AirWareGIS, the file ./defaults/nonlayout has to be edited. To add an overlay to the general GIS,

  • increase *general.n_maps: entry in ./defaults/nonlayout by 1 (e.g., from 14 to 15)
  • add the name of the new overlay to the list (e.g., *general.map15: newmap.
The same can be done to any of the study areas (instead of general use casestudy.

The config_file

The config_file should contain the following lines, in the given order (please note that lines starting with a # are ignored and can therefore be used for comments):
xtrafile file with description of attributes such as color, legend entry, etc. (see the description of the xtrafile below).
mapset Arc/Info or GRASS mapset for input data
dirpath main output path: directory where the results of the conversion should be placed
resdirpath resolution data path relative to dirpath: if different resolutions are to be generated, they should be put into different subdirectories; resdirpath can also be "." (no subdirectory)
name the overlay name that will be displayed for selection in the AirWare GIS
treshold this is an indicator for filtering the data for different resolutions: if thresh is 0., all points are taken, otherwise only points with a distance greater than thresh from a line joining the previous and next point are taken: eliminates co-linear points and points very close to each other. thresh is in map coordinates
type type number of the overlay (must be 0)
non_active_fit 1 = this overlay can't be chosen as the largest to fit to the map window, else 0
map1 (file) name of the first map
map2 if the map is tiled, the individual files that should be taken from the mapset directory are listed here.
.
mapn

The lines xtrafile, mapset and dirpath are restricted to 100 characters, resdirpath to 20 characters. The line with the overlay name can theoretically have up to 100 characters, but considering the limited space available for display in XENVIS's GIS, not more than 26 characters should be used. Thresh expects a float, and the map names can have any length, as their space is allocated dynamically.

This is an example of a working config_file for vector data:

#
# CIA River
#

# xtra file
../xtra/cia_river
# GRASS Mapset or Arc/Info workspace
/p/aca/AirWare/maps/
# Output Directory
../cia_riv_hi
# Output Sub directory for High resolution
HiRes
# Name to be displayed in GIS selector
Rivers, CIA Database II
# Threshold
0.0
# Type
0
# Nonactive Fit
1
# Map tiles
criv_afr
criv_asi

The xtrafile

The xtrafile has 3 main parts:
  • color specification,
  • property specification,
  • attribute specification.
Not all 3 parts must be present, but the specified order is fixed: first all colors, then all properties and finally all attributes have to be defined.

Lines starting with a # are ignored and can therefore be used for comments, but no comment should occur between curly brackets { and }. Each (color, property, or attribute) specification must start with its respective keyword (COLOR, PROPERTY, ATTRIBUTE) and contains { and }, where } must be in the first column of a line (see syntax and example below).

Each color specification consists of 3 lines, where the floats red, green and blue range between 0.0 and 1.0.

COLOR <(integer) color_number> {
        <(float) red> <(float) green> <(float) blue>
}
An example to define the color ORANGE:
COLOR 140 {
        1.0 0.7 0.0
}

Each property specification consists of 4 lines, where all text strings can have up to 32 characters, except data, which can have up to 80 characters:

PROPERTY <(integer) property_number> `<(text string) property_name>' {
        datatype `<(text string) type>'
        data `<(text string) data>'
}
An example to define the legend entry Roads:

PROPERTY 225 `roads' {
        datatype `legend_entry'
        data `Roads'
}

An attribute specification can only relate to attributes, colors and properties earlier defined. Styler (for setting the graphics context) and modifier (for non standard drawing) used should already be defined in the styler and the modifier function of the application. All text strings can have up to 32 characters:

ATTRIBUTE <(integer) attribute_number> `<(text string) attribute_name>' {
        [property <(integer) number> `<(text string) name>']
                  ...
        [property <(integer) number> `<(text string) name>']
        [attribute <(integer) number> `<(text string) name>']
                  ...
        [attribute <(integer) number> `<(text string) name>']
        [color <(integer) number>]
        [style <(integer) number>]
        [modify <(integer) number>]
}
As an example we relate legend entry Roads (=225), color ORANGE (=140), style 0 (default: plain line) and modifier 1 (line width gets bigger with zooming in) to attribute 1 (corresponds to items labeled 1 in coverage):
ATTRIBUTE 1 `roads' {
        property    225 `Legend Roads'
        color   140
        style 0
        modify 1
}
A number of examples can be found in the directory ./data/maps/xtra on the distribution tape.

NoData Overlays

nodatafilter4 will create an overlay without topological data. The corresponding config_file should be in the following format:
xtrafile file containing attribute descriptions, such as color, legend entry, etc. see the description of an xtrafile above
dispath directory where the result of conversion should be included
resdirpath if different resolutions are to be generated, they should be put into different subdirectories, resdirpath being relative to dirpath; resdirpath can be `.' (no subdirectory)
name the overlay name will be displayed for selection in the AirWare GIS
type type of the overlay (must be 0)
non_active_fit if 1 then this overlay can't be chosen as the largest map for fitting to the map window, else 0
north coordinates of bounding box (float, map coordinates)
south
east
west

Cell Grids

Digital Elevation Models, satellite images, and other information in a raster format are provided in a cell grid format as input for AirWare. To import these data, a filter cellfilter4 converts the band interleaved by line (BIL) format into the data representation used in the XENVIS system (a description of the filter is given below). BIL is standard raster format used by GRASS. ArcInfo allows you to export to BIL format.

The command to filter the data is cellfilter4 config_file (see below the description of the corresponding config_file).

If no error message occurs, a new overlay should be created in the directory specified in the config_file. To include this new overlay into the AirWare GIS, the file ./defaults/nonlayout has to be edited. To add an overlay to the general GIS, increase *general.n_maps: entry in ./defaults/nonlayout by 1 (eg. from 14 to 15) and add the name of the new overlay to the list *general.map15: newmap.

The config_file

The config_file should contain the following lines, in the given order (please note that lines starting with a # are ignored and can therefore be used for comments):
Xtrafile file containing attribute descriptions, such as color, legend entry, etc. (see the description of the xtrafile below)
InputDir GRASS/ArcInfo BIL input data directory
CellFname GRASS/ArcInfo BIL input data file
OutputPath directory where the result of conversion should be included
OvName name of overlay file basic structure data file (colors, legends, etc.)
OvItemName the name to be displayed for selection in the AirWare GIS
OvType type number of the overlay - 0 for regular, 23 for time series
NonActiveFit if fit=1 overlay should not be used as largest for fitting of maps
OutputDataFile output data file (cell values) name
OutputCellPath if different resolutions are to be generated, they should be put into different subdirectories, resdirpath being relative to dirpath see section Changing Overlay Resolutions When Zooming
CellType char, uchar, short, ushort, int, uint, float
Rows number of rows in the cell grid
Cols number of columns in the cell grid
XMin x origin of map coordinates
YMin y origin of map coordinates
XMax x maximum of map coordinates
YMax y maximum of map coordinates
Width width of the cell grid map
Height height of map
Swap swap the y coordinates y/n
Data no data value
AttLabType attribute label type
This is an example of a config_file for cell grid data:
# xtrafile
XtraFile=../xtra/etopo5
# cell file directory
InputDir=/p/aca/gis1/XENVIS/bil
# cell file
CellFName=etopo5.bil
# main output path
OutputPath=../etopo5
# name of overlay
OvName=overlay
# item name in the overlay structure
OvItemName=Hypsography
# type number of the overlay
OvType=0
# non_active_fit
NonActiveFit=0
# name of output data file
OutputDataFile=etopo5
# output cell path
OutputCellPath=HiRes
# cell type
CellType=short
# number of rows
Rows=1415
# number of cols
Cols=1886
# x-origin in map coordinates
XMin=-7698399.5
# y-origin in map coordinates
YMin=-6012901
# width of map
Width=17495897.674
# height of map
Height=13126560.866
# swap y coordinates (y/n)
SwapY=n
NoData=10000

xtrafile

The xtrafile for vector maps and cell grids follows the same structure.

Changing Overlay Resolutions When Zooming

For the fastest possible drawing of overlays, you may filter overlays into different resdirpath or OutputCellPath. The file scale2res must be placed in the OutputPath. scale2res acts as a switch from one resolution to another. For example, ./data/maps/general/etopo5/scale2res looks like this:
# min scale -     max scale    -    resolution directory
#========== -     =========    -    ====================
1.0 : 1         -       4.0 : 1    -          LowRes
4.0 : 1         -     300.0 : 1    -           HiRes
The numbers on the left of 1 are the zoom factors. In this example, when you zoom into an area that does not exceed a zoom factor of four (i.e., the max scale of 4.0 : 1 the overlay in the LowRes directory will be drawn. As soon as you zoom into an area more than a zoom factor of four (that is, larger than max scale) the overlays will be switched and the one in HiRes will be drawn. There is no limit to the number of resolutions you may have and you may edit the scales as you wish.


© Copyright 1995-2016 by:   ESS   Environmental Software and Services GmbH AUSTRIA | print page