Database control file

The database control file includes all the information the program needs, from all databases and their different associations. File is divided into two different parts:

Commands

Four functions are connected to the processing of the database. Every function has its own line in the control file. The line is given in SQL format and has in its parameters (#) the variables the program needs. In the SQL line it is easy to give the definitions connected to the database e.g. the variables names and extensions.

The four commands needed are:

SELECT import points from database

INSERT export points to database

UPDATE updating the points in the database

DELETE deleting points from the database

You can use macro #DATE to get current date.

All commands are sent to SQL-server as they are in the control file, you can use all the features of SQL. E.g. if you want to use automatic point numbering, try the following command::

insert into punktreg (pbet,px,py,pz,objektid) values ('xx10','10','10','10',(seq1.nextval))

Field names

3D format uses for each point, six fields and three coordinates. In the database they probably have different names and maybe different meanings. A command must be made in the control file as to how the 3D fields are to link to the database fields.

Following control lines are used:

1-6 code fields T1-T6

name database table field name

type A=text, N=numeric

width field width in format width. decimals, for example 14.3

minus aligns text to the left

constant constant value for field

7-9 coordinates X, Y, Z

point coordinates, format same as above.

You can define total width and number of decimals, e.g. 10.3 or 0.3.

10-12 second point coordinates X, Y, Z

point coordinates for possible second line point, format same as above.

21 special search condition

Makes it possible to give other search conditions. The line format is otherwise the same as above, but at the end of the line, there is text which will appear in the dialog and file, in which a list of search conditions can be written.

21 Quality A -10 Qualityclass C:\data\db\geonic\quality.lst

You can use comments in this file after ‘ -character. Comment will be shown in the selection list, but is included in the SQL-command.

E.g. 12345 'explanation

The special search condition can be used with a database column which is not even read into 3D-Win.

Notice, that you can additional rules into SELECT-command by appending them with WHERE-definition. E.g.. WHERE YEAR=2000.

50 line curvature

optionsdifferent options as a binary sum

1 redraw after fetching

2 create new file element

4 rename new file using table name

64 read radius (not bulge)

128 create second point

256 use T4 as area name and connect lines afterwards

512 show messages

bulge curvature factor field name

scale scaling factor for curvature

51 maximum number of points to read

max point amount

52 use of geodetic coordinates (latitude, longitude)

zone zone to be used in calculation (18,21,24,27,30). If zero (0), point zone will be used.

Lat1 name of the accurate lat-coordinate

Lon1 name of the accurate lon-coordinate

Lat2 name of the approximate lat-coordinate

Lon2 name of the approximate lon-coordinate

Approximate values (Lat2,Lon2) will be used only, if they are defined in this line and accurate coordinates are not available

53 move coordinate system

dx X-offset

dy Y-offset

dz Z-offset

This works for reading and writing the database. Use positive values to add the offset in reading database. If you use the same control file for writing, the offset value signs are changed automatically.

Search window works correctly with offset. Window coordinates are modified using the offset values.

58 code conversion file

name the whole name of code conversion file used for T3 code field.

Same rules as for normal code conversion file:

left side = code in 3D and right = code in database

101-999 attributes

name database table field name

type A=text, N=numeric

width field width in format width. decimals, for example 14.3

minus aligns text to the left

attr attribute in format #Fname

Fdiverse options as binary sum

0 do not save with point

1 copy to point1

2 copy to point2

name attribute name or code field number

1-6 code field number, for example #14

other attribute name, for example #1DIA

Notice !

Line type database table the numbers 111-113 are reserved :

111 right side area code

112 left side area code

113 flow direction (water pipe)

Text type tables the numbers 190-199 are reserved :

190 text

191 text size

192 text angle (gon 0-400, 100=horizontal)

193 text color (color index)

194 text alignment (1-9)

See also : Special setting for database

Examples:

Database of points. Geonic file as a database table

!
!  File  TESTI.DAT
!
!  Copyright © 1998 3D-system Oy       12.08.1998
!
! Commands
SELECT SURFACE,LINE,CODE,NUMBER,X,Y,Z from TESTI.GT
INSERT into TESTI.GT (SURFACE,LINE,CODE,NUMBER,X,Y,Z) VALUES (#1,#2,#3,#4,#7 #8,#9)
UPDATE TESTI.GT SET SURFACE=#1,LINE=#2,CODE=#3,NUMBER=#4,X=#7,Y=#8,Z=#9 WHERE CODE=#3 AND NUMBER=#4
DELETE from TESTI.GT where CODE=#3 AND NUMBER=#4
!
! Fields
1 SURFACE  A  8
2 LINE     A  8
3 CODE     A  8
4 NUMBER   A  8
7 X        N  0
8 Y        N  0
9 Z        N  0

Database of lines.

!
!  File  KUOPIO2.DAT
!
!  Copyright © 1998 3D-system Oy       12.08.1998
!
! Commands
SELECT X1,Y1,Z1,X2,Y2,Z2,T41,T42,R1,R2,Oikea,Vasen from KUOPIO2
INSERT into KUOPIO2 (T41,T42,X1,Y1,Z1,X2,Y2,Z2,R1,R2,P,Oikea,Vasen) VALUES ($101,$102,#7,#8,#9,#10,#11,#12,$103,0.0,0.0,$111,$112)
UPDATE KUOPIO2 SET X1=#7,Y1=#8,Z1=#9 WHERE T4=#4
DELETE from KUOPIO2 where X1=#7 and Y1=#8
!
! Fields
3  T3    A  0 100
7  X1    N  9.1
8  Y1    N  9.2
9  Z1    N  9.3
10 X2    N  9.1
11 Y2    N  0.2
12 Z2    N  0.3
!
!21 PUNKT_TYP        A  -5  Quarter  C:\3d\database\sto\kortteli.lst
50 391 R1 -2
!58 c:\kuopio.exc
101 T41              A   0     #14
102 T42              A   0     #24
103 R1               N   10.6  #0
111 Oikea            A   4     #4Oikea
112 Vasen            A   4     #4Vasen