C
A
R
T
O
S
C
R
I
P
T
S

Getting Started

Using CartoScripts

Using
CartoScripts™

with

TNTmips®
TNTedit™
®
TNTview
page 1

Using CartoScripts

Before Getting Started
Some mapping projects may require the use of specialized symbols for lines andpoints in vector and CAD objects. The cartographic scripting language in TNTmips®, TNTview®, and TNTedit™ provides a complete and flexible set of drawing
functions that allow you to design custom map symbols for many applications.
CartoScripts extend the symbol-creation capabilities found in the standard point
and line style editors in the TNT products. The exercises in this booklet introduce the most commonly-used CartoScript functions, and provide many sample
CartoScripts for point and line symbols.
Prerequisite Skills This booklet assumes that you have completed the exercisesin the following Getting Started booklets: Displaying Geospatial Data, Navigating, Creating and Using Styles, and Building and Using Queries. Those exercises
introduce essential skills and basic techniques that are not covered again here.
Please consult those booklets and the TNTmips reference manual for any review
you need.
Sample Data The exercises presented in this booklet use sample data that is

distributed with the TNT products. If you do not have access to a TNT products
CD, you can download the data from MicroImages’ web site. In particular, thisbooklet uses the CARTOSMP, TOWNS and GGMAP Project Files in the CARTOSCR datacollection. Install the sample files on your hard drive so changes can be saved as
you work with them.
More Documentation This booklet is intended only as an introduction to using

CartoScripts to style vector or CAD elements. For more information consult the
Display Volume of the TNTmips reference manual.
TNTmips and TNTlite® TNTmips comes in two versions: the professional ver-sion and the free TNTlite version. This booklet refers to both versions as“TNTmips.” If you did not purchase the professional version (which requires a
hardware key), TNTmips operates in TNTlite mode, which limits object size anddoes not allow export. All of the exercises can be completed in TNTlite using thesample geodata provided.
Randall B. Smith, Ph.D., 28 August 2002
©MicroImages, Inc., 1999
It may be difficult to identify the important points in some illustrations without acolor copy of this booklet. You can print or read this booklet in color fromMicroImages’ web site. The web site is also your source for the newest Getting
Started booklets on other topics. You can download an installation guide, sample
data, and the latest version of TNTlite.
http://www.microimages.com
page 2

Using CartoScripts

Welcome to Using CartoScripts
The style editors in TNTmips and TNTview allow
you to select, modify, combine, or create a wide variety of standard point and line symbols, as describedin Getting Started: Creating and Using Styles. For
those instances in which the standard style editors
cannot provide the appropriate symbol, you can use
CartoScripts™ to design custom map symbols forpoints and lines.
CartoScripts are style scripts that utilize special functions in the TNTmips Query language (in the
Cartoscripts function group). The CartoScript functions allow you to draw and navigate along line
elements and to draw new lines and shapes to form
symbols. Symbols can be repeated along line elements or drawn singly for point elements. You can
add labels to the symbols using text from associateddatabase tables and optimize label placement within
a single drawing layer. You can also structure a script
to use element attributes to vary the symbol styling.
The exercises in this booklet introduce and explain
the most commonly-used CartoScript functions andshow how you can structure scripts to produce various effects for point and line symbols. CartoScripts
are subject to the same syntax rules as standard
database queries and SML scripts. For a review ofbasic query syntax, consult Getting Started: Buildingand Using Queries.
Geologic maps are one example of maps requiring
specialized point and line symbols that can be drawn
using CartoScripts. Point symbols are used to indicate the orientation of outcrop-scale structures, while
special line symbols are used to represent map-scalefeatures. Several of the exercises in this booklet use
geological examples to illustrate elements ofCartoScript structure.

STEPS
þ make sure the sample
files mentioned on page
2 have been copied toyour hard driveþ start TNTmips
þ choose Display / Spatial
Data from the mainmenu
The exercises on pages 419 illustrate the use of
CartoScript functions tocreate point symbols. Pages
4-8 introduce the basic
functions used to draw lines
and simple geometricshapes. Pages 9-19 lead
you through adding text
labels from database fields,
drawing more complex
symbols, varying symbol
orientation by attribute, andoptimizing label placement.
The exercises on pages 2033 show you how to use
CartoScripts to create line
symbols. Basic line
navigation and drawing
functions are introduced on
pages 20-22. Script
structures to create repeatedsymbols and placement oftext labels for lines are
explained on pages 23-33.
Use of CartoScripts withlegends is discussed on
pages 34-37, and pages 3839 provide a complete list ofavailable CartoScript
functions.

You can download additional sample CartoScripts for geological point and line
symbols from the MicroImages web site:www.microimages.com / freestuf / cartoscripts
page 3

Using CartoScripts

Draw Simple Point Symbols
STEPS
þ click the New 2DGroup icon
button on the Display
toolbarþ click on the Add
Vector icon buttonin the Group Controls
window and choose Add
Vector Layerþ navigate to the CARTOSMP
Project File in the
CARTOSCR data collection
and select the SAMPLES
vector object
þ click on the Points tab on
the Vector Layer
Controls window
þ select By Script from theStyle option menu andclick [Specify...]þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object FLAGQRYfrom the CARTOSMP
Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

The CartoScript you open in this exercise(shown in the box below) draws the flag
symbol shown to the right. The first linein the script is a comment line with thescript name (remember that comments arepreceded by the “#” character). The LineStyleSetColor( ) function in Line 2 sets Red, Green, and Bluevalues (between 0 and 255) that determine the colorof lines drawn by the drawing functions that follow(in this case, red lines). The function in Line 3 sets
the line width for the drawing functions (more about
this below).

The remaining script lines actually draw the symbol. The LineStyleLineTo( ) function draws a line
to the point specified by a direction (first numericparameter) and distance (second parameter). The
LineStyleMoveTo( ) function uses the same sequenceof parameters to move the “pen” location without
drawing. Both functions reference a local coordinate system centered on the current point element(the script is read and evaluated once for each point
element in the object). Directions for these functions are specified by angles (0 to 180 and 0 to -180)
relative to the positive x axis of the object coordinate system. Object coordinates also provide thedefault units for the distance parameters in
1 ## FlagQry
2 LineStyleSetColor(225,0,0); these functions, as well as for the width parameter in the LineStyleSetLineWidth( )3 LineStyleSetLineWidth(1);4 LineStyleLineTo(90,20);
function. The sequence of drawing actions
5 LineStyleLineTo(-30,8);
is illustrated below, with the dot indicating
6 LineStyleLineTo(-150,8);
the pen position at the end of each action.
7 LineStyleMoveTo(-90,12);
8 LineStyleLineTo(0,8);
LineTo(90,20)
LineTo(-30,8)

+90

+180
-180

LineTo(-150,8) MoveTo(-90,12)

0-90page 4

LineTo(0,8)

Using CartoScripts

Using Anchors
In the sequence of drawing movements in the flag STEPS
script in the previous exercise, the pen position re- þ click the Vector
icon button in theturns to the origin of the local coordinate system
Layer icon row to open
before drawing the final line at the base of the flag.
the Vector Layer
Controls window
The simple geometry of the flag symbol makes itþ reopen the Query Editor
relatively easy to calculate the angle and distance forwindow for point styles
the LineStyleMoveTo( ) function in Line 7 that þ delete the statement with
the LineStyleMoveTo( )moves the pen to the origin. But you can avoid thefunction and insert theneed for such calculations by using anchors: posistatements shown intions you record for later use in a set of drawing
bold text below
actions. The LineStyleDropAnchor( ) function sets þ click [OK] in the Query
Editor window and again
an anchor position and assigns it the number you
in the Vector Layer
enter as the numeric parameter for the function. The
Controls window
LineStyleMoveToAnchor( ) function moves the pen
to the specified anchor position. There is alsoa LineStyleLineToAnchor( ) function that LineStyleSetColor(225,0,0);
LineStyleSetLineWidth(1);draws a line from the current pen position to LineStyleDropAnchor(1);the specified anchor position. You can es- LineStyleLineTo(90,20);
tablish multiple anchor points to aid in LineStyleLineTo(-30,8);
drawing complex symbols, and use them in LineStyleLineTo(-150,8);
LineStyleMoveToAnchor(1);any order. In the script on this page, we place LineStyleLineTo(0,8);
an anchor at the origin before LineStyleMoveToAnchor(1);beginning to draw, and return to LineStyleLineTo(-135,8);
the anchor position twice more
to draw lines from the base of theflag.
You can manuallyenter function
names, databasefield names, symbol
names, or operators,
or use the options on
the Insert menu toinsert the required
items into the script.

Choose Cartoscript from the Function
Group menu to see a function list with
only the CartoScript style functions.

page 5

Using CartoScripts

Using Built-in Geometric Shapes
STEPSþ reopen the Query Editor
window for point styles
þ edit the script toduplicate the text below;
the new statement is inbold type

Several functions that draw simple geometric shapes
are included in the CartoScript function set. The
LineStyleDrawRectangle( ) and LineStyleDrawCircle( ) functions draw their respective shape centeredon the current pen position, which is left unchanged.
The first script for this exercise draws a filled
LineStyleSetColor(225,0,0); rectangle at the base of the flag symbol. FourLineStyleSetLineWidth(1);numeric parameters are used in this instance
LineStyleDropAnchor(1);to control the rectangle function: width,
LineStyleLineTo(90,20);
height, angle, and dofill. The first two paLineStyleLineTo(-30,8);
LineStyleLineTo(-150,8);
rameters are required, and specify the width
LineStyleMoveToAnchor(1);and height of the rectangle. The third
LineStyleDrawRectangle(10,5,0,1);(optional) parameter specifies a rotation angle, which in this example is equal to zero.
þ click [OK] in the Query
The last parameter (also optional) determines whethEditor window and again
er the shape is filled with the current line color (1),in the Vector Layer
Controls windowor left unfilled (0).
The second example in this exercise draws an unfilled ellipse at the base of the flag symbol. The
LineStyleDrawEllipse( ) function has up to 7 parameters: angle, distance, radius_x, radius_y, rotangle,
isAngleAbs, and dofill; the first four are required.
The initial angle and distance parameters allow youþ reopen the Query Editor
to automatically move the pen to a new position bewindow
fore drawing. In this example, both are set to zero,þ replace the last line inleaving the ellipse centered on the base of the flag.
the script with thestatement shown below
The pen returns to the ellipse center after drawing.
The ellipse dimensions are iniLineStyleDrawEllipse(0,0,8,3,30,0,0);
tially set parallel to the x and ycoordinate
axes
by
the
two radius parameters (in thisþ click [OK] in the Query
example, 8 and 3 units, respectively). The value of
Editor window and again
in the Vector Layer
30 for the angle parameter rotates the ellipse 30 deControls window
grees counterclockwise. The isAngleAbs parameter
determines whether the ellipse is drawn and rotatedrelative to the local coordinate system (0), or relative to global object coordinates (1). This distinction
does not exist for point data, but becomes importantwhen styling lines, as we will see later.

page 6

Using CartoScripts

Recording and Drawing Polygons
Styling for the ends of lines is set using the Line- STEPS
StyleSetCapJoinType( ) function, which has capstype þ reopen the Query Editor
window for point styles
and jointype parameters. The capstype parameter þ edit the script todraws square line ends when set to 1, or rounded
duplicate the text below,
adding the statement
ends when set to 0. The jointype parameter uses theshown in bold typesame values to determine styling for theends of segments of a polygon outline or LineStyleSetColor(225,0,0);polyline. The default value for both pa- LineStyleSetLineWidth(1);rameters is 0, so rounded ends are drawn LineStyleSetCapJoinType(1,1);
LineStyleLineTo(90,20);
if you do not include this statement in a LineStyleLineTo(-30,8);
LineStyleLineTo(-150,8);
script.
The script in the second half of this exercise draws a þ click [OK] in the Query
Editor window and again
solid-color flag symbol by drawing the triangular flagin the Vector Layerelement as a filled polygon. You can draw simple orControls window
complex polygon shapes by using functions to execute the following steps: 1) initiate recording ofvertex locations; 2) move to or draw lines to eachvertex location in turn; 3) connect the vertices to draw
the polygon. The LineStyleRecordPolygon( ) function has a single start_stop parameter; a value of 1
þ reopen the Query Editor
starts recording vertex locations specified by pen
window
movements in subsequent statements. The Line- þ change the values forthe cap and join
StyleDrawPolygon( ) function forms a polygon usingparameters as shown,
the recorded vertices, and has a single dofill paramand add the statements
eter (set to 1 in this example to fill the triangle). The
shown in bold
LineStyleDrawPolygon( ) function also stops the re- þ click [OK] in the Query
Editor window andcording of vertex LineStyleSetColor(225,0,0);again in the Vector
locations, so there is LineStyleSetLineWidth(1);Layer Controls
no need to explicitly LineStyleSetCapJoinType(0,0); window
LineStyleLineTo(90,20);
stop recording with a
LineStyleDropAnchor(2);LineStyleRecord- LineStyleRecordPolygon(1);Polygon(0) statment LineStyleLineTo(-30,8);
following the vertex LineStyleLineTo(-150,8);
movement list. You LineStyleMoveToAnchor(2);LineStyleDrawPolygon(1);can also use the samestructure to record vertex locations to connect as þ select Close from theGroup menu when you
segments of a single line with the LineStyleDrawhave completed thisPolyline( ) function.
exercise

page 7

Using CartoScripts

Using 3D Shapes
STEPSþ click the Open
icon button on
the Spatial Data Display
toolbar and choose
Open Group from themenuþ select the CUBEGROUP
object from the CARTOSMP
Project Fileþ click the Vector
icon button in theLayer icon row for the
SAMPLES layer to open the
Vector Layer Controls
windowþ open the Query Editor
window for point styles
and examine the script
CUBEQRY1
þ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

CartoScript functions are also available to draw perspective renderings of simple three-dimensional
shapes: a rectangular solid, vertical cylinder, andvertical cone. Edge lines in each symbol are drawn
using the color specified by the LineStyleSetColor( )function. Three color parameters for each function
set the red, green, and blue values for the fill color.
The cube symbol is drawn with the base of the front
face centered on the current pen position. The cylinder and cone symbols are drawn so that the centerof the basal ellipse coincides with the current pen
position.
The width, depth, and height parameters for the LineStyleDrawCube( ) function specify the lengths of thecorresponding edges of the rectangular solid. If you
want the symbol to appear in perspective as a true
cube, as in this exercise, the width and height shouldbe equal and the depth value should be about half
the length of the other dimensions.
You can define numeric or string variables in a script
for later use as function parameters. Defining variables (with comments) at the beginning of a script
makes it easier to find and edit necessary parametervalues when you are reusing and modifying a script.
LineStyleDrawCylinder( )LineStyleDrawCube( )# CubeQry1# Set dimensions of cube symbol
width = 15;
depth = 0.5 * width;height = width;# Set color for cube faces
red = 255; green= 0; blue = 0;

LineStyleDrawCone( )# Draw cube symbol
LineStyleSetColor(0,0,0);# line color for edges
LineStyleSetLineWidth(0);LineStyleDrawCube(width,depth,height,red,green,blue);

page 8

Using CartoScripts

Text Labels from Database Fields
The script in this exercise adds a boxed text label tothe cube symbol. The additional statements needed
to format and draw the label are shown below. The
label is a sample number stored as a numeric value
in a database field. In order to use it as a label, thenumber must first be converted to a text string andassigned to a string variable using the sprintf( ) function. The first parameter in this function is a string(in quotes) with formatting information; “%d” indicates an integer value. The second parameter in thiscase is the location of the numeric value, specified
in the form TableName.FieldName.
Text labels are drawn with the lower left corner corresponding to the pen position. The orientation of alabel is set by the angle parameter. The border parameter specifies the width of the border between
the text label and its surrounding box. The last parameter shown here, isAbs(0), indicates the reference
frame of the angle parameter.
# Read sample number from database field and# convert to text string for use as a label
label$ = sprintf(“%d”,Samples.Number);

STEPS
þ click the Vector
icon button for the
SAMPLES layer to reopen
the Vector Layer
Controls windowþ open the Query Editor
window for point styles
þ choose Open / RVC
Object from the Filemenuþ select object CUBEQRY2
in the CARTOSMP ProjectFileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

You should get in the
habit of terminating eachstatement in a script witha semicolon (;). This
helps the syntax checker
pinpoint the location ofsyntax errors.

# String variable for label text font
font$ = “ARIALBD.TTF”;# Define color variables for text
tred = 0;
tgreen= 0;
tblue = 0;
# Define fill color variables for text box
fillred = 255;
fillgreen = 255;
fillblue = 170;
# Define height, angle, and border width of text box
t_height = 10;
angle = 0; border = 2;
# Set color and font for text label
LineStyleSetTextColor(tred,tgreen,tblue,fillred,
fillgreen,fillblue);
LineStyleSetFont(font$);# Move pen to right of symbol and draw label
LineStyleMoveTo(0, width * 1.2);
LineStyleDrawTextBox(label$,t_height,angle,border,0);

page 9

Using CartoScripts

Setting Coordinate Type Options
STEPS
þ zoom in and out andnote the effect on therelative sizes of point
symbols and contours
þ reopen the Vector Layer
Controls window for the
SAMPLES layer and Query
Editor window for pointstylesþ choose Open / RVC
Object from the Filemenuþ select object CUBEQRY3from the CARTOSMP
Project File

The default units for the size and distance values you
use in CartoScripts are in internal object coordinates(meters for the objects you have used in these exercises). Thus as you change zoom levels, the size ofthe symbols on the screen change as the display scalechanges, maintaining a constant size in object coordinates. The script in this exercise adds the statement
shown in bold type to the previous CubeQry2 (alongwith changes in the symbol and label size values). A
parameter value of 1 for the LineStyleSetCoordType( ) function changes the size and distance units
to millimeters at the current display scale or print
scale. When you change zoom levels or
print scales, symbols maintain a constant# CubeQry3# Set dimensions of cube symbol display size in millimeters. This setting
LineStyleSetCoordType(1);works best with layouts designed only
width = 4;
for display (A value of 0 for this padepth = 0.5 * width;
rameter is equivalent to the default
height = width;
condition).

þ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window
þ zoom in and out and notethe effect on the relative
sizes of the symbols andcontour lines
þ select Close from theGroup menu when you
have completed thisexercise, and click [No]on the dialog when you
are asked
whether tosave changes
to the group

If you are using CartoScripts to draw map elements
designed for printing at a particular scale (such as
1:24,000), you can use the default coordinate setting
to maintain the relative sizes of different elements at
different zoom levels for screen display, but use themap scale to compute the element sizes needed to
produce the desired sizes on the final printed map.
See the script on pages 14-15 for an example of thisscaling approach.

Different zoom levels with default scaling to
object coordinates. The point symbol has aconstant size in object coordinates.

page 10Different
zoom levels
with scaling
to millimeters. The point symbol maintains a constant size in screen (orprint) coordinates.

Using CartoScripts

3D Cylinder Bar Graph
The 3D symbols can be combined together to form
3D bar graphs, with the height of each bar determined by the value in a database field. You canchange the perspective of the cylinder and cone symbols by varying the relative lengths of the long andshort axes of the cylinder and cone base.
The LineStyleTextNextPosition( ) function is usedin this script to approximately center the “Cu” element label below its cylinder. The first fourparameters of this function specify the string, its
height, angle, and local or absolute coordinate reference. The last three parameters, next_x, next_y, andlength, are variables which the function creates tohold the x-coordinate, y-coordinate, and length ofthe label string. These values can be used in subsequent statements to guide positioning.

STEPS
þ click the New 2DGroup icon
button on the Display
toolbarþ click on the Add
Vector icon buttonand choose Add VectorLayer
þ select the GEOCHEMVEC
object from the CARTOSMP
Project Fileþ set point styling to By
Script and open theQuery Editor window
þ choose Open / RVC
Object from the Filemenuþ select object CYLINGRAPH
in the CARTOSMP ProjectFileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window# Read values for element abundances from# database and assign to variables to use# for cylinder heights
cuVal = Geochemistry.Cu;
pbVal = Geochemistry.Pb;
znVal = Geochemistry.Zn;# Set edge line color and cylinder dimensions
LineStyleSetColor(0,0,0);
longAxis = 120;
shortAxis = 50;# Set text color and font
LineStyleSetTextColor(0,0,0);
LineStyleSetFont(“ARIALBD.TTF”);# Draw three cylinders side by side
LineStyleDropAnchor(1);LineStyleDrawCylinder(longAxis,shortAxis,cuVal,255,0,0);
LineStyleMoveTo(0,longAxis); # move right by width of cylinder
LineStyleDrawCylinder(longAxis,shortAxis,pbVal,0,255,0);
LineStyleMoveTo(0,longAxis);
LineStyleDrawCylinder(longAxis,shortAxis,znVal,0,0,255);# Draw label centered below each cylinder
LineStyleMoveToAnchor(1);# move to base of first cylinder
LineStyleMoveTo(-90,100);# move down to make room for label
LineStyleTextNextPosition(“Cu”,70,0,0,next_x,next_y,length);
LineStyleMoveTo(180,length * 0.4);# move label point to left
LineStyleDrawText(“Cu”,70,0,0);# to center first label
LineStyleMoveTo(0,longAxis);# move right by width of cylinder
LineStyleDrawText(“Pb”,70,0,0);þ remove the GEOCHEMVEC layer when
LineStyleMoveTo(0,longAxis);
you have completed this exercise
LineStyleDrawText(“Zn”,70,0,0);

page 11

Using CartoScripts

Orienting Symbols by Attribute
STEPS
þ click on the Add
Vector icon button andchoose Add VectorLayer
þ select the ARROWPTS
object from the CARTOSMP
Project Fileþ set point styling to By
Script and open theQuery Editor window
þ choose Open / RVC
Object from the Filemenuþ select object ARROWQRY1
in the CARTOSMP ProjectFileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window
headSizesweepAngle

You can use a script to draw symbols that vary inorientation depending on a direction value read froma database field. In this instance the arrow directions are in azimuth form (0 to 360° angle measured
clockwise from north), and must be converted to theinternal coordinate system used by the drawing functions. This script also converts all negative direction
values to the corresponding positive values, but thisconversion is not required.
The LineStyleDrawArrow( ) function draws arrowheads bounded by straight lines whose length isdefined by the headSize variable in this script. The
angle between these bounding lines is set by thesweepAngle parameter. If the dofill parameter is set
to 1, the head is filled to form a solid triangle. The
function updates the pen position to the tip of thearrow head. Arrow heads do not render well with aline width larger than 0, so this script draws the arrow with 0 line width, then redraws the arrow stemwith a wider line.

# Read azimuth from database tableazim = Direct.Azimuth;# Convert azimuth to internal coordinate system
direction = -(azim - 90);
if (direction < 0) then direction = direction + 360;
# Set color values for symbol
red = 0;green = 0; blue = 0;
LineStyleSetColor(red,green,blue);# Set dimensions for arrow
arrowLength = 30;
headSize = 0.4 * arrowLength;
sweepAngle = 40;
dofill = 1;
# Draw arrow with zero line width, tip of stem at point
LineStyleDropAnchor(0);# anchor at point
LineStyleSetLineWidth(0);LineStyleDrawArrow(direction,arrowLength,headSize,sweepAngle,dofill);
LineStyleDropAnchor(1);# anchor at tip of arrow# Redraw arrow stem with wider line
stemLength = arrowLength - headSize * cosd(sweepAngle);
LineStyleMoveToAnchor(0);LineStyleSetLineWidth(1.5);
LineStyleLineTo(direction,stemLength);
LineStyleMoveToAnchor(1); # pen to arrow tip in prep for label

page 12

Using CartoScripts

Calculating Label Positions
The script in this exercise adds a label with the azimuth to each arrow symbol from the previous
exercise. The additional statements needed to format and draw the labels are shown below. The tricky
part is varying the label position based on the arroworientation to avoid overlap between the arrow andits label. The script computes two pen shifts which
are applied before the label is drawn, as explained in
the comments. Each is computed as a function of
the direction angle and the height and length of thelabel string. The second shift must be computed separately for each quadrant, being careful that theresulting distance is a positive value (values for distance parameters of drawing functions must be
positive; a negative value is interpreted as equal to
0).

STEPS
þ reopen the Query Editor
window for point styles
þ choose Open / RVC
Object from the Filemenuþ select object ARROWQRY2
in the CARTOSMP ProjectFileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

þ remove the
ARROWPTS layer
when you havecompleted this exercise# Convert azimuth value to text string for use as a label
label$ = sprintf(“%d”,azim);# Find length of label text for label positioning
height = 10;
LineStyleTextNextPosition(label$,height,0,0,next_x,next_y,length);# Set font name and color
LineStyleSetFont(“ARIALBD.TTF”);
LineStyleSetTextColor(red,green,blue);# Compute label shift perpendicular to arrow to center label
shift1 = 0.5 * (height*cosd(direction) - length*sind(direction));# Compute label shift parallel to arrow to avoid overwriting arrowoffset = arrowLength * 0.1;
if (direction >= 0 and direction < 90) thenshift2 = offset;
else if ( direction >= 90 and direction < 180 ) thenshift2 = offset - length * cosd(direction);else if ( direction >= 180 and direction < 270 ) thenshift2 = offset - length * cosd(direction)- height * sind(direction);else if ( direction >= 270 and direction <= 360 ) thenshift2 = offset - height * sind(direction);# shift pen position and draw label
if (shift1 < 0 ) {# MoveTo distances can’t be less than 0
shift1 = abs(shift1); # absolute value
LineStyleMoveTo(direction + 90,shift1); }else LineStyleMoveTo(direction - 90,shift1);
LineStyleMoveTo(direction,shift2)
LineStyleDrawText(label$,height,0,0)

page 13

Using CartoScripts

Drawing Strike and Dip Symbols
STEPS
þ click on the Add
Vector icon button andchoose Add Vector Layerþ select the BEDDING object
from the CARTOSMP ProjectFileþ set point styling to By
Script and open theQuery Editor window
þ choose Open / RVC
Object from the Filemenuþ select object BEDDINGQRY
in the CARTOSMP ProjectFileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window
þ select Close from theGroup menu when you
have completed thisexercise

Inclined

Geologic maps use special point symbols to indicate
the orientation of planar or linear structures in rockoutcrops. The script in this exercise draws standard
symbols showing the strike and dip of layering (bedding) in sedimentary rocks, as shown below. It uses
many of the functions and concepts introduced previously. The dip and strike are read from anassociated database table. (The strike angle must be
specified as an azimuth using the so-called right-handrule: the strike line points toward the azimuth forwhich the dip direction is to the right.) The symbol
is oriented so that the long (strike) line is parallel tothe strike direction, and the symbol is labeled withthe value of the dip angle. Special symbols are drawn
for horizontal and vertical beds (special values ofthe dip angle), and for overturned beds (indicated bya logical field in the database). The second half ofthe script, which labels the symbols with the dip value, resembles the script on the previous page, and is
not shown here.
Overturned

Horizontal

Vertical# BeddingQry# Read strike azimuth and dip value from table.fieldazStrike = Bedding.Strike;
dip1 = Bedding.Dip;# Check logical field for overturned bedding. Variable is set# to 1 if Yes, 0 if No
overturned = Bedding.Overturned;# Variables define the color of the symbols and label
red = 0;green = 0;blue = 0;# This variable defines the denominator of the intended map scale.
scale = 5000;# These variables define the dimensions and line widths of the# symbol. strikeLengthMap is the desired length of the symbol# strike line in mm, assuming vector coordinates are in meters.
# lineWidthMap is the desired line width in mm.
strikeLengthMap = 6;
lineWidthMap = 0.3;
strikeLength = strikeLengthMap * scale / 1000;
halfLength = 0.5 * strikeLength;
tickLength = halfLength / 3;
doubTick = tickLength * 2;
lineWidth = lineWidthMap * scale / 1000;

page 14

Using CartoScripts

Strike and Dip Script (continued)###### Process# Convert strike azimuth to internal coordinate system.
direction = -(azStrike - 90);
if (direction < 0) thendirection = direction + 360;
oppStrike = direction -180;
dipDir = direction - 90;
oppDip = dipDir - 180;
# Set line color, width, and end type
LineStyleSetColor(red, green, blue); # set symbol color
LineStyleSetLineWidth(lineWidth);
LineStyleSetCapJoinType(1,1); # square ends of lines########### Draw symbol# Special symbol for horizontal bedding (cross in circle)
if (dip1 == 0){
LineStyleDropAnchor(0);LineStyleDrawCircle(halfLength);
LineStyleMoveTo(90, halfLength);
LineStyleLineTo(-90, strikeLength);
LineStyleMoveToAnchor(0);LineStyleMoveTo(0, halfLength);
LineStyleLineTo(180, strikeLength);}else {# For nonzero dip, draw strike line with center at point
LineStyleDropAnchor(0);LineStyleMoveTo(direction, halfLength);
LineStyleLineTo(oppStrike, strikeLength);
LineStyleMoveToAnchor(0);# Draw appropriate symbol for dip direction
if (dip1 == 90) {# crossbar for vertical bed
LineStyleMoveTo(dipDir, tickLength);
LineStyleLineTo(oppDip, doubTick);}else {
if (overturned == 1) {# dip symbol for overturned beds
LineStyleDrawArc(0, 0, tickLength, tickLength,
direction, -180, 0);
LineStyleMoveTo(direction, tickLength);
LineStyleLineTo(oppDip, doubTick);}else {# dip direction tick mark
LineStyleLineTo(dipDir, tickLength);}}}

page 15

Using CartoScripts

Label Optimization
STEPS
þ click the Open
icon button on
the Display Spatial Data
toolbar and choose
Open Group from themenuþ select the OPTGROUP
object from the TOWNS
Project Fileþ click the Vector
icon button for the
TOWNS layer to open the
Vector Layer Controls
windowþ open the Query Editor
window for point styles
and examine the script
OPTQRY1
þ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window
Label Optimization is aprocedure for automaticallyfinding the optimal set of
positions for point symbol
labels generated from a
database field. The goal is
to avoid overprinting one
label with a nearby symbol’s
label. Individual labels canbe moved or deleted to
avoid these collisions. The
optimizer can automaticallyplace a label in one of anumber of different positions
around the symbol. The
preferred position places thelower left corner of the labelon the point. Points can beranked using attributeinformation, and theserankings can be used by the
optimizer to give preference
to higher-ranking points
when moving or deletinglabels.

The display group used in this exercise shows a blockof counties in eastern Nebraska and the included
towns and cities. In the script on the facing page the1990 populations of the towns are used to assign eachto one of three rank values. The rankings are used to
draw point symbols of different sizes, and they arealso used by the label optimizer to select labels fordeletion.
A CartoScript is executed once for each element inan object, yet label optimization requires information about all labels to resolve positioning conflicts.
To solve this dilemma, optimization scripts use the
LineStyleAddToOptimizer( ) function to collectinformation about the dimensions of each label. Afterall points have been processed, the optimizer moves
or deletes labels as needed, then calls a function called
FuncDrawLabel( ) to draw the labels. The
instructions for this function must be included in afunction definition in the script, as shown at thebottom of the facing page. This definition should
specify the font, color, and height of the label, andinclude the LineStyleDrawText( ) or LineStyleDrawTextBox( ) function.
The first four parameters of the LineStyleAddToOptimizer( ) function are used to determine thedimensions of a label’s bounding rectangle. The
xstart and ystart parameters set the lower left cornerof the label, and can be read from the internal object
coordinates as shown. The xlast and ylast parameters,
which set the upper right corner, can be calculated
from the label height and the length parameter
returned by the LineStyleTextNext-Position( )function. A value of 0 for the dooptimize parameter
limits changes in label position to a single passthrough the point labels. The final dodelete parameteris used to turn label deletion on (1) or off (0). With
deletion on, a conflicting label of equal or lower rank
may be deleted during optimization.

page 16

Using CartoScripts

Optimization with Ranked Deletion

Display of groupwith ranked
deletion. Circles
indicate towns forwhich the label
was deleted during
optimization.

There are some random aspects# Rank towns by population
to label position changes during
pop = TownData.POP90
if (pop < 1000) then rank = 1;
optimization, so redrawing thegroup may cause some labels toelse {
change position and previously
if (pop >= 100000 ) then rank = 3;
deleted labels to reappear. The
else rank = 2;
illustration above shows one}
possible set of label positions.
# Draw circle with size based on rank
radius = rank * 500;
LineStyleSetColor(255,0,0);
LineStyleDrawCircle(radius,1);# Read label text and determine dimensions
height = 3500;
LineStyleSetFont(“ARIALBD.TTF”);
LineStyleTextNextPosition(TownData.NAME,height,0,0,next_x,
next_y,length);# Define parameters for optimization
xstart = Internal.x;
ystart = Internal.y;xlast = xstart + length;ylast = ystart + height;
dooptimize = 0;
dodelete = 1;
LineStyleAddToOptimizer(xstart,ystart,xlast,ylast,rank,
dooptimize,dodelete);# Define required function to draw labels after optimization
func FuncDrawLabel() {LineStyleSetFont(“ARIALBD.TTF”);
LineStyleSetTextColor(0,0,0);height = 3500;
LineStyleDrawText(TownData.NAME,height,0,0);}

page 17

Using CartoScripts

Full Label Optimization
STEPS
þ open the Query Editor
window for point styles
þ choose Open / RVC
Object from the Filemenu
þ choose object OPTQRY2
from the TOWNS ProjectFileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

þ close the current display
group when you havecompleted this exercise,and click [No] on the
dialog when you are
asked whether to savechanges to the group

Full label optimization is enabled by setting the value of the dooptimize parameter in the
LineStyleAddToOptimizer( ) function to 1. The optimizer then makes multiple passes through the pointlabels to determine optimal label positions. The
script on the facing page uses full optimization without deletion to place labels. It also assigns different
label sizes and colors for towns of different rank, as
illustrated below.
Note that the FuncDrawLabel( ) function cannot directly access any of the variable values assigned in
the main body of the script (including the rank variable used by the optimizer). In order to vary thelabel drawing style by rank, as in this script, theFuncDrawLabel( ) function declaration must repeat
the ranking procedure found in the main body of thescript (as well as the font assignment, source of thelabel text, and other label attributes).

page 18

Using CartoScripts

Full Optimization Script# Label sizes for three sizes of towns
small = 2500; med = 3500;
big = 4500;# Rank towns by population
pop = TownData.POP90;
if (pop < 1000) then {rank = 1; height = small;}else {
if (pop >= 30000 ) then {rank = 3; height = big;}else {
rank = 2; height = med;}}
# Draw circle with size based on rank
radius = rank * 500;
LineStyleSetColor(255,0,0);
LineStyleDrawCircle(radius,1);

CartoScript Shortcut
Any point symbol that you
design using the Point Style
Editor can also be saved asa CartoScript, complete withdeclared variables andcomments. You can use
this shortcut to create thebasic script structure, thenadd any custom features orreferences to databasefields as needed.

# Read label text and determine dimensions
LineStyleSetFont(“ARIALBD.TTF”);
LineStyleTextNextPosition(TownData.NAME,height,0,0,next_x,
next_y,length);# Define parameters for optimization
xstart = Internal.x;
ystart = Internal.y;xlast = xstart + length; ylast = ystart + height;
dooptimize = 1;
dodelete = 0;
LineStyleAddToOptimizer(xstart,ystart,xlast,ylast,rank,
dooptimize,dodelete);# Define required function to draw labels after optimization
func FuncDrawLabel() {small = 2500;
med = 3500;
big = 4500;
pop = TownData.POP90;
if (pop < 1000) {height = small; LineStyleSetTextColor(0,0,0);}else {
if (pop >= 30000 ) {height = big;
LineStyleSetTextColor(255,0,0);}else {
height = med;
LineStyleSetTextColor(0,0,255);}}
LineStyleSetFont(“ARIALBD.TTF”);
LineStyleDrawText(TownData.NAME,height,0,0);}

page 19

Using CartoScripts

Contour Line Width by Script
STEPS
þ click the New 2DGroup icon
button on the Display
toolbarþ click on the Add
Vector icon buttonin the Group Controls
window and choose Add
Vector Layerþ select object CONTOURS
from the CARTOSMP
Project Fileþ click on the Lines tab on
the Vector Layer
Controls window
þ select By Script from theStyle option menu andclick [Specify...]þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object CONQRY
from the CARTOSMP
Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls windowþ use the Zoom Box
tool to zoom in on
the area of closed
contours near the bottomof the object

CartoScripts can also be used to draw simple or complex symbols for line elements in vector or CAD
objects. The most basic function for drawing line
symbols is the LineStyleDrawLine( ) function, which
has no parameters. It simply draws a solid line foreach line element using the color set by the LineStyleSetColor( ) function and the width set by the
LineStyleSetLineWidth( ) function. It returns the pen
position to the beginning of the line after drawing.
The script in this exercise draws lines with different
widths for major and minor elevation contours. The
original map has a contour interval of 40 feet, andevery fifth contour (evenly divisible by 200 feet) is amajor contour shown by a wider line. In TNTmips,
however, internal Z-values are stored in meters. The
script reads the minimum z-value for the line fromthe Internal table and converts it to feet. The elevationin feet is then divided by 200 using the modulo
operator, which returns the remainder of the division,
stored here in the variable rem. The value of rem is
0 only for major contours, so this value is used toassign the appropriate width before drawing the line.

# ConQry# Read contour elevation & convert to feetelevm = Internal.MinZ;
elevft = round(elevm * 3.28084);# Use modulo operator to# identify contour elevations# that are not evenly divisible# by 200 (nonzero remainder)
rem = elevft % 200;
# Define widths for minor and# major contours
if (rem <> 0) then width = 2;
else width = 6;
# Set line color and width and# draw line
LineStyleSetColor(170,85,0);
LineStyleSetLineWidth(width);
LineStyleDrawLine();page 20

Using CartoScripts

Navigating Lines
Other drawing functions can be used in conjunction
with the LineStyleDrawLine( ) function to create
more complex line symbols. The script in this exercise first draws the line element as a solid line, thendraws circles of different size and color at each endof the line. This script could be used for vector line
elements you are editing in the Spatial Data Editor.

STEPS
þ reopen the Query Editor
window for line styles
þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object
STARTENDQRY from the
CARTOSMP Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

A number of functions are provided to allow you tonavigate along a line element in order to draw symbol components. The LineStyleSetPosition( ) function is used in this script to move the pen position to
the end of each line after marking the start. The
single numeric parameter of # StartEndQry
this function specifies a line # Set radius parameters for small andposition as a relative dis- # large circles
tance between 0 (beginning radius1 = 8; radius2 = 16; dofill = 0;
# Set line color and width and draw lineof the line) and 1.0 (end of LineStyleSetColor(170,85,0);
the line). You can use the LineStyleSetLineWidth(4);LineStyleGetPosition( ) LineStyleDrawLine();function to find the current # Draw small red circle at start of line
LineStyleSetColor(225,0,0);
pen position and assign the LineStyleDrawCircle(radius1,dofill);value returned to a variable. # Move to end of line and draw large
Set this function’s single pa- # green circle
rameter to 0 if you want the LineStyleSetPosition(1);LineStyleSetColor(0,225,0);
returned value to be the rel- LineStyleDrawCircle(radius2,dofill);
ative position. If you set it
to 1, the value returned is the absolute distance fromthe start in object coordinates.
Start: 0
Relative position on line elements
using the LineStyleSetPosition( ) and
LineStyleGetPosition( ) functions.
Middle: 0.5

End: 1.0

page 21

Using CartoScripts

Marking Line Vertices
STEPS
þ click on the Add
Vector icon button in theGroup Controls window
and choose Add VectorLayer
þ select object STREAMS
from the CARTOSMP
Project Fileþ click on the Lines tab on
the Vector Layer
Controls window
þ select By Script from theStyle option menu andclick [Specify...]þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object VERTEXQRY
from the CARTOSMP
Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

Cartoscripts can also mark line vertices as an aid toediting. The script in this exercise draws a red circle
at the beginning of each line element, and a green
circle at each subsequent vertex.
The LineStyleNextVertex( ) function used in thisscript moves the pen position to the next vertex along
the line. The function also returns a value of 1 if theend of the line has been reached, or 0 otherwise. (TheLineStylePrevVertex( ) function moves to the previous vertex, and returns a value of 1 at the beginningof the line.) These functions can thus be used in a“while” loop structure to repeat a set of drawing actions at each vertex. In this script, the “while” loop
repeats as long as the LineStyleNextVertex( ) function returns a value of 0. The loop terminates when
the function returns a value of 1 at the end of theline.

# VertexQry# Set parameters for circles# marking vertices
radius = 5;
dofill = 0;
# Draw solid black line
LineStyleSetLineWidth(3);LineStyleSetColor(0,0,0);
LineStyleDrawLine();# Draw red circle at beginning of line
LineStyleSetColor(225,0,0);
LineStyleDrawCircle(radius,dofill);# While not at end of line, move toþ remove the STREAMS layer# next vertex and draw green circle
when you have completed
LineStyleSetColor(0,225,0);
this exercise
while (LineStyleNextVertex() <> 1) {LineStyleDrawCircle(radius,dofill);}

page 22

Using CartoScripts

Drawing Regularly Spaced Symbols
Line symbols you create for use in map layouts may
include components spaced regularly along each line
element. This exercise illustrates the basic structureof such a script by drawing filled circles equally
spaced along the lines.
The LineStyleRoll( ) function moves a specified distance along a line element without drawing. The
distance to move is set by the value of the single
function parameter. The function also returns a value of 0 for any line position except the end, where it
returns a value of 1. By checking this returned value
you can use the function in a “while” loop structure
to repeat a set of drawing actions at regular intervals
along each line.
This script is structured to continue drawing circles
as long as the distance from the current position to
the end of the line is greater than the desired spacing. The LineStyleGetDistanceTo( ) function is used
to check this distance. The distance to various linefeatures can be determined by setting the appropriate parameter value for this function, as shown inthe box to the right.
# CircLineQry# Set parameters for circles
radius = 6;
dofill = 1;
# Set spacing between circles
spacing = 30;# Set line color and width and draw line
LineStyleSetColor(170,85,0);
LineStyleSetLineWidth(3);LineStyleDrawLine();# Draw circle at start of line
LineStyleDrawCircle(radius,dofill);# Draw rest of circles
while (LineStyleRoll(spacing) <> 1) {dist = LineStyleGetDistanceTo(3);if ( dist > spacing) {LineStyleDrawCircle(radius,dofill);}}

page 23

STEPS
þ reopen the Query Editor
window for line styles for
the CONTOURS object
þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object CIRCLINEQRY
from the CARTOSMP
Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

Parameter values for the
LineStyleGetDistanceTo( )function:
1 = next vertex
2 = previous vertex
3 = end of line
4 = beginning of line

Using CartoScripts

Positions and Coordinate Systems
STEPSþ reopen the Query Editor
window for line styles for
the CONTOURS object
þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object TICKLINEQRY
from the CARTOSMP
Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window+90
Pointer
Position 1

0-90Line Start-90

The CartoScript drawing engine keeps track of two
positions during execution of a script. The first is
the current position along a line element, which you
can think of as a “pointer” that is moved along theline by the LineStyleRoll( ) function or the other line
navigation functions. The second position that istracked is the pen position, which may or may not beon the line element.
The current pointer position serves as the origin of a
local coordinate system that is oriented relative tothe line element as shown in the boxed illustration.
The drawing functions that use angle and distanceparameters to move the pen position or draw elements, such as LineStyleLineTo( ) and+90
LineStyleDrawArrow( ), reference thislocal coordinate system. This systemenables you to draw repeated symbol0components that are oriented consistently
relative to the local line direction, such
Pointeras the perpendicular tick lines in the
Position 2
script in this exercise. The tick lines are
drawn on the left side of each line (relative to the start and end points). If asymmetric symbols such as this need to be drawn on a particularside of each line, you may need to use theSpatial Data Editor to reverse the direction of individual lines in order to create
the desired symbol.

# TickLineQry# Denominator of# desired map scale
scale = 5000;# Desired spacing and# length of tick lines# in mm at map scale
spaceMap = 6; lengthMap = 1.5;
# Scaled spacing and length# of tick lines
spacing = spaceMap * scale / 1000;
length = lengthMap * scale / 1000;# Set line color and width and draw line
LineStyleSetColor(170,85,0);
LineStyleSetLineWidth(3);LineStyleDrawLine();# Draw tick lines
LineStyleLineTo(90,length);while (LineStyleRoll(spacing) <> 1) {LineStyleMoveTo(0,0);
LineStyleLineTo(90,length);}

page 24

Using CartoScripts

More About Pen Position
When you use the LineStyleRoll( ) function, you needto keep in mind that it moves the pointer, but not thepen position. In many scripts this fact is not obvious
because most of the local-reference drawing functions automatically move the pen to the origin of thelocal coordinate system before drawing. In the circle-line script (page 21), for example, the LineStyleDrawCircle( ) function automatically moves the pen
to the current pointer position after each LineStyleRoll action. One function that does not update thepen position before drawing is the LineStyleLineTo( ) function. This function draws a line from thecurrent pen position to a point specified in
the local coordinate system. When you want
to use this function in a LineStyleRoll loop
to draw a line beginning at the origin of thelocal coordinate system, as in the tick line
script on the preceding page, use the statement “LineStyleMoveTo(0,0)” to move thepen to the current pointer position before
drawing.

STEPS
þ reopen the Query Editor
window for line styles for
the CONTOURS object
þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object
SINEWAVEQRY from the
CARTOSMP Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

The peculiarities of the LineStyleRoll( ) and
LineStyleLineTo( ) functions were engineered for a purpose. They make it possible to draw
dashed or continuous lines offset from the vector line
element. The script in this exercise shows an elegant example, a line symbol that looks like acontinuous sine curve. The “curve” is actually madeup of small straight-line# SineWaveQry
segments drawn by the # Set line color and width
LineStyleLineTo( ) func- LineStyleSetColor(0,0,0);
tion. Each iteration of the LineStyleSetLineWidth(3);“while” loop increments # Set sine wave parameters
angle = 0;
space = 4;
the angle for the sine func- # Draw line
tion by one radian, while (LineStyleRoll(space) <> 1) {angle = angle + 1;
# in radians
producing a sinusoidallya = sin(angle) * 5;
# amplitude
varying amplitude for theif (a > 0) then LineStyleLineTo(90,a);
LineStyleLineTo( ) funcelse LineStyleLineTo(-90,abs(a));
tion.
}page 25

Using CartoScripts

Drawing Dashed Lines
STEPS
þ reopen the Query Editor
window for line styles for
the CONTOURS object
þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object BARBQRY
from the CARTOSMP
Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

To draw simple or complex dashed lines, you can
use a “while” loop to alternate LineStyleRoll( ) and
LineStyleRollPen( ) actions. The LineStyleRollPen( ) function draws a line along a line element fora specified distance beginning at the current pointerposition. The drawing distance is set by the value ofthe single function parameter. For a simple dashedline with dashes and spaces of equal size, use thesame distance for both the LineStyleRoll( ) and LineStyleRollPen( ) functions.
The script in this exercise is a bit more elaborate,
adding a tick line with a filled circle at the end in the
middle of each dash. In each iteration of the “while”
loop, the LineStyleRollPen( ) function draws the firsthalf of a dash, then the tick line and circle are drawn,
and finally the second half of the dash is drawn.

# BarbQry# Set line color and width
LineStyleSetColor(170,85,0)
LineStyleSetLineWidth(3)# Set dash parameters
dashSize = 20
half = 0.5 * dashSize# Set circle parameters
radius = 3;
dofill = 1# Draw line
while (LineStyleRoll(dashSize) <> 1) {dist = LineStyleGetDistanceTo(3)if (dist > dashSize) {LineStyleRollPen(half)
LineStyleMoveTo(0,0)
LineStyleDropAnchor(0)LineStyleLineTo(90,half)
LineStyleDrawCircle(radius,dofill)
LineStyleMoveToAnchor(0)LineStyleRollPen(half)}
else LineStyleRollPen(dist)þ remove the CONTOURS}
layer when you havecompleted this exercise

page 26

Using CartoScripts

Double Dashed Lines
The script in this exercise illustrates another dashedline variation. It draws each line with double dashes
connected by crossing lines. Each pair of dashes iscentered on the line element, which means that thedashes themselves are offset from the line by a distance specified by the offset variable. Because nopart of the symbol traces the line element itself, the
LineStyleLineTo( ) function is used to draw both thedashes and the crossing lines.
# DoubDashQry
dashSize = 15;
halfDash = dashSize * 0.5;
double = 2 * dashSize;
offset = dashSize * 0.2;
doubOffset = offset * 2;
# Set line color and width
LineStyleSetColor(255,0,0);
LineStyleSetLineWidth(2);# Draw double dash line and crossing lines
LineStyleMoveTo(90, offset);
LineStyleLineTo(0, dashSize);
LineStyleMoveTo(-90, doubOffset);
LineStyleLineTo(180, dashSize);
LineStyleMoveTo(0, halfDash);
LineStyleLineTo(90, doubOffset);
while (LineStyleRoll(double) <> 1) {dist = LineStyleGetDistanceTo(3);if (dist > dashSize) {LineStyleMoveTo(90, offset);
LineStyleLineTo(0, dashSize);
LineStyleMoveTo(-90, doubOffset);
LineStyleLineTo(180, dashSize);
LineStyleMoveTo(0, halfDash);
LineStyleLineTo(90, doubOffset);}}

page 27

STEPS
þ click on the Add
Vector icon button in theGroup Controls window
and choose Add VectorLayer
þ select object STREAMS
from the CARTOSMP
Project Fileþ click on the Lines tab on
the Vector Layer
Controls window
þ select By Script from theStyle option menu andclick [Specify...]þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object
DOUBDASHQRY from the
CARTOSMP Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

Using CartoScripts

Handling Multiple Repeat Intervals
STEPS
þ reopen the Query Editor
window for line styles for
the STREAMS object
þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object DASHDIQRY
from the CARTOSMP
Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

Line symbols can include components repeated at
different intervals along the line, as illustrated by
the dashes and diamonds drawn by the script in thisexercise. The variable cumL in the script keeps trackof the cumulative length of dashes and spaces drawn
since the last diamond symbol. When the value ofcumL reaches the spacing distance set for the
diamonds, a diamond symbol is drawn instead of adash, and the value of cumL is reset to 0. The
diamond symbol is created here using the LineStyleSideshot( ) function. This function allows you
to specify a number of points by angle and distancein the local coordinate system, and connect them toform a polyline by setting the value of the dodraw
parameter to 1. This script also records the points
as a polygon so the diamond shape can be filled.

# DashDiQry# Set line color and width
LineStyleSetColor(225,0,0);
LineStyleSetLineWidth(2);# Set dash parameters
dashSize = 12;
half = 0.5 * dashSize;# Set diamond parameters
spacing = 5 * dashSize;
dodraw = 1;
dofill = 1;
width = 0.3 * dashSize;cumL = 0; # Cumulative length variable# Draw line
while (LineStyleRoll(dashSize) <> 1) {cumL = cumL + dashSize;# increment cumulative lengthif (cumL >= spacing) {# draw diamond symbol
LineStyleRoll(half);
LineStyleMoveTo(0,0);
LineStyleRecordPolygon(1);LineStyleSideshot(dodraw,0,half,90,width,180,
half,-90,width);
LineStyleDrawPolygon(dofill);
LineStyleRoll(half);cumL = 0;# reset cumulative length to 0}
else {LineStyleRollPen(dashSize);# draw dashcumL = cumL + dashSize;# increment cumulative length}}

page 28

Using CartoScripts

Dashed Thrust Fault Symbol
The script in this query provides another example ofsymbols using different repeat intervals. It draws
the dashed version of the geologic map symbol for athrust fault. The triangles are drawn as polygons
using anchor points placed at the corners. The basesof the triangle symbols are drawn using the LineStyleRollPen( ) function so that they conform tocurves in the line elements. Note that a negative
distance can be used with the LineStyleRoll( ) function to move backward along a line element.

STEPS
þ reopen the Query Editor
window for line styles for
the STREAMS object
þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object
DASHTHRUSTQRY from the
CARTOSMP Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window# DashThrustQry
dashSize = 16;# length of dashes
halfDash = dashSize * 0.5;
# triangle spacing and dimensions
spacing = dashSize * 6 ;quartSpace = spacing * 0.25;
þ remove the STREAMS
triWidth = dashSize;layer when you
halfTri = triWidth * 0.5;
have completed thisheight = dashSize * 0.6;
exercise# Set line color and width
LineStyleSetColor(255,0,0);
LineStyleSetLineWidth(2);# Initialize variable to control placement of triangles
cumL = spacing;# Draw dashed fault line and triangles
while (LineStyleRoll(halfDash) <> 1) {dist = LineStyleGetDistanceTo(3);# distance to end of line
cumL = cumL + dashSize;
if (dist > quartSpace and cumL >= spacing) {LineStyleDropAnchor(1);LineStyleRoll(halfTri);LineStyleMoveTo(0,0);
LineStyleMoveTo(90, height);
LineStyleDropAnchor(2);LineStyleRoll(-halfTri);LineStyleRecordPolygon();LineStyleRollPen(triWidth);
LineStyleLineToAnchor(2);LineStyleLineToAnchor(1);LineStyleDrawPolygon(1);cumL = 0;}else {LineStyleRollPen(dashSize);
cumL = cumL + dashSize;}}

page 29

Using CartoScripts

Labeling Contour Lines
STEPS
þ click on the Add
Vector icon button in theGroup Controls window
and choose Add VectorLayer
þ select object CONTOURS
from the CARTOSMP
Project Fileþ click on the Lines tab on
the Vector Layer
Controls window
þ select By Script from theStyle option menu andclick [Specify...]þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object CONLABLQRY
from the CARTOSMP
Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window
Current
line
position

maxDist fromLineStyleGetMaxDistance( )Straight line joining endpoints

You can design a CartoScript to vary the placement
and orientation of line symbol components toaccomodate the local direction and shape of the line
elements. In this script that draws and labels contours, the elevation labels for the major contours are
moved if the local portion of the line is too highly
curved, and are inverted if necessary to be readable.
(Only the main processing portion of the script isshown on the next page).
These conditions are checked using the LineStyleGetDirection( ) and LineStyleGetMaxDistance( ) functions. The first parameter of both
functions is a value that specifies the length of the
portion of the line that you want to examine. The
additional parameters of both functions are variables
that are assigned values by the function. The LineStyleGetDirection( ) function finds the minimum andmaximum direction angles for the specified line segment in the object coordinate reference frame (positive x-axis = 0 degrees). The LineStyleGetMaxDistance( ) function finds the maximum perpendicular distance between the specified portion of theline element and a straight line joining its endpoints(see illustration at left), as well as the direction angle of this straight line (used in this script to orient
the contour label). Both functions return a value of
1 if at the end of the line element, or 0 otherwise.
The script checks the maximum distance value aswell as the change in line direction over the label length
to determine if the local portion of the line is too highly
curved to place the label
there. The direction angle ofthe label line is used to identify labels that need to be inverted.
þ remove the CONTOURS
layer when you havecompleted this exercise

page 30

Using CartoScripts

Labeling Contour Lines (continued)
if (rem <> 0) {# draw minor contours
LineStyleSetLineWidth(width);
LineStyleDrawLine();}else {# draw and label major contours
LineStyleSetLineWidth(widthBold);
str$ = sprintf(“%d”,elev); # read elevation to string variable# find length of contour label
LineStyleTextNextPosition(str$,labelSize,0,1,nextx,
nexty,length);
begShift = 5 * length;# offset from beginning of line
stopLength = begShift;# min label distance from end of line
spLength = 1.5 * length;# label length plus spaces
LineStyleRollPen(begShift);# draw beginning of contour line

while ((LineStyleGetMaxDistance(spLength,drawAngle,
maxDist)) <> 1) {LineStyleGetDirection(0.1 * labelSize,minAngle,maxAngle);# find change in line direction over length of label
devAngle = drawAngle - minAngle;# find distance to end of line and compare to stopLength
remLength = LineStyleGetDistanceTo(3);if (remLength < stopLength) break;# check deviation distance and angle of line segment
if ((maxDist < 1.5 * labelSize) and (abs(devAngle) < 15)) {LineStyleRoll(0.25*length); # space before drawing label

page 31

00
84

84
00

LineStyleSetLineWidth(widthBold);
LineStyleRollPen(minDistBetweenLabels);}+180
else LineStyleRollPen(length);}180# Draw remainder of line
LineStyleRollPen(remLength);
Invert}00
84# Check if label needs to be inverted to be readable
isInverse = 0;
if (abs(drawAngle) > 90) isInverse = 1;
if (isInverse) {LineStyleMoveTo(devAngle, length);
LineStyleMoveTo(devAngle + 90, halfSize);
LineStyleDrawText(str$,labelSize,drawAngle+180,1);}
else {LineStyleMoveTo(-90,halfSize);
LineStyleDrawText(str$,labelSize,drawAngle,1);}
LineStyleRoll(1.2 * length);
Invert+90
LineStyleMoveTo(0,0);

84
00

-90

0

Using CartoScripts

Syncline Line Symbol
STEPS
þ click on the Add
Vector icon button in theGroup Controls window
and choose Add VectorLayer
þ select object SYNCLINE
from the CARTOSMP
Project Fileþ click on the Lines tab on
the Vector Layer
Controls window
þ select By Script from theStyle option menu andclick [Specify...]þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object
SYNCLINEQRY from the
CARTOSMP Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

A CartoScript can be structured to draw different line
symbols depending on the attributes attached to theline elements. The script in this exercise draws geological line symbols for the axial trace of a synclinal(downward) fold in layered rocks. If one limb of thefold has rotated beyond a vertical orientation, the foldis overturned, and a special symbol is used. The
overturned condition for vector lines in this exercise
is indicated by a logical database field.
This script draws each line element as a solid line,
then places the fold symbol in the middle of the line.
The semicircle that forms part of the overturned
syncline symbol is drawn using the LineStyleDrawArc( ) function, which draws an arc about a specified
center point. The first two function parametersspecify an angle and distance to the intended center
point of the arc, so you have the option of moving
the pen to a new location before drawing the arc.
You also specify a starting angle and sweep angle
for the arc, and have the option of rotating the entire
arc after drawing by assigning a nonzero value forthe rotangle parameter.

# SynclineQry# Read a logical database field (Yes/No) to check if syncline is# overturned. Numeric variable is set to 1 if yes, 0 if nooverturned = Syncline.Overturned;# dimensions of arrow symbols
arrowSize = 30;
halfSize = arrowSize * 0.5;
headSize = 0.5 * arrowSize;sweepAngle = 45;
stemSize = arrowSize - headSize * cosd(sweepAngle);
width = 2;
# width of lines# Parameters for half circle in overturned syncline symbol
angle = 0; shift = halfSize; # angle and distance to arc centerradius_x = halfSize;# radii of arc
radius_y = halfSize;startAngle = -180;
swpAngle = -180;
rotAngle = 0;
isAngleAbs = 0;
# Set line color, width, and draw fold line
LineStyleSetColor(228,0,0);
LineStyleSetLineWidth(width);
LineStyleDrawLine();page 32

Using CartoScripts

Syncline Line Symbol (continued)# Draw arrow symbols in middle of each line
LineStyleSetPosition(0.5);# move to middle of line
if ( overturned == 1 ) {# draw overturned syncline symbol# Draw arrows with 0 line width
LineStyleRoll(-halfSize);
LineStyleDropAnchor(1);LineStyleSetLineWidth(0);LineStyleMoveTo(-90, arrowSize);
LineStyleDropAnchor(2);LineStyleDrawArrow(90, arrowSize, headSize, sweepAngle, 1);
LineStyleMoveTo(0, arrowSize);
LineStyleMoveTo(-90, arrowSize);
LineStyleDropAnchor(3);LineStyleDrawArrow(90, arrowSize, headSize, sweepAngle, 1);# Draw arrow stems and arc with linewidth = width
LineStyleSetLineWidth(width);
LineStyleMoveToAnchor(2);LineStyleLineTo(90, stemSize);
LineStyleMoveToAnchor(1);LineStyleDrawArc(angle, shift, radius_x, radius_y,
startAngle, swpAngle, isAngleAbs);LineStyleMoveToAnchor(3);LineStyleLineTo(90, stemSize);}else {# draw upright syncline symbol# Draw arrows with 0 line width
LineStyleDropAnchor(1);LineStyleSetLineWidth(0);LineStyleMoveTo(90, arrowSize);
LineStyleDropAnchor(2);LineStyleDrawArrow(-90, arrowSize, headSize, sweepAngle, 1);
LineStyleMoveToAnchor(1);LineStyleMoveTo(-90, arrowSize);
LineStyleDropAnchor(3);LineStyleDrawArrow(90, arrowSize, headSize, sweepAngle, 1);# Redraw arrow stems
LineStyleMoveToAnchor(2);LineStyleSetLineWidth(width);
LineStyleLineTo(-90, stemSize);
LineStyleMoveToAnchor(3);LineStyleLineTo(90, stemSize);}

page 33

This script draws the dip arrows
for the overturned syncline
symbol on the right side of aline element. Line directions
have been set in the vector
object to accomodate thisscript design.

Using CartoScripts

Add Elements to LegendView
STEPSþ make sure that lines are
selectable in the View
window

þ select the
GeoToolbox fromthe View window
þ turn on the Selecttool in the
GeoToolbox
window
þ in the View window, leftclick on one of the twolines drawn with the
upright syncline symbolþ press and hold the rightmouse button and selectAdd Active Line toLegend from the popup
menu

Vector style samples appear automatically in LegendView when you style points, lines, or polygons
using the All Same, By Attibute, or By Theme style
options. But when you style vector elements using a script, the “styles” created by your script do
not automatically appear in LegendView; insteadthe current All Same style for the element appears in LegendView by default.
You can create LegendView samples for vector elements styled by script by selecting from the View
window a representative element for each drawing“style” and adding it to LegendView. You must use
the selection tools in the GeoToolbox to perform theselection (you cannot use the simple Select tool on
the View window).
In this exercise you select two lines from the syncline vector layer, one styled with the normal upright
syncline symbol and the other with the overturned
syncline symbol. When each LegendView sample is rendered in the window, the script is
executed using the database attributes of the element you selected for it.

þ when the Legend
Element Label window
appears, enter “Syncline”
in the text field and press[OK]

A special database table is created to identify theelements you have selected for the legend. The
table also stores the label text for each sample.
þ repeat the last threesteps for the line drawn
with the overturned
syncline symbol, entering“Overturned Syncline” forthe labelpage 34

Using CartoScripts

Script Variables for Legend Samples
Notice that the syncline symbols drawn in LegendView in the previous exercise overlap each otherbecause they appear too large for the legend spacing. LegendView assigns a rectangular area to eachsample, and the general scaling parameters included
in your script for map rendering may not provide agood fit to that area.
Several script variables let you set up special processing to better scale symbols for legends. When
the Display process renders a sample in LegendView
using a script, the variable DrawingLegendView is
automatically assigned a value of 1. (Its value is 0
when the script is rendering elements in the view.)
You can therefore set up a conditional loop in thescript that checks this value and executes only when
the script is drawing a sample for LegendView.
When a legend sample is being rendered,class SampleRect is created automaticallyto allow you to access the coordinates andsize of the sample rectangle. SampleRect
is an instance of the general class Rect,
which includes methods GetHeight() and
GetWidth() that you can use to find either
dimension of the rectangle. The CartoScript in this exercise uses the height ofthe sample rectangle to scale the syncline
symbols in LegendView. The relevant
portion of the script is excerpted below.

STEPS
þ open the Vector Layer
Controls window andclick on the Lines tabþ select Straight from the
Legend Style menu on
the lower part of thepanel
þ reopen the Query Editor
window for line styles
þ choose Open / RVC
Object from the Filemenu in the Query Editor
window
þ select object SynQryLgn
from the CARTOSMP
Project Fileþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window

The default shape for a line sample inLegendView is zigzag. Complex line
symbols drawn by CartoScript lookbetter in LegendView when drawn with
the Straight legend style option.

# These variables control the length of the arrows# ArrowLengthMap is the desired arrow length in mm,# assuming vector coordinates are in meters:
if (DrawingLegendView == 1) {þ close theArrowSize = 0.5 * SampleRect.GetHeight();
current display}
group whenelse {
you have
ArrowLengthMap = 4;
completed thisArrowSize = ArrowLengthMap * Scale / 1000;
exercise}

page 35

Using CartoScripts

CartoScript Samples in Printed Legends
STEPS
þ click the Open
icon button on
the Spatial Data Display
toolbar and choose
Open Layout from themenuþ select PRINTLAYOUT fromthe GGMAP Project File
þ in the Layout
Controls window,
click on the
Legend icon button for
the Symbols legend
þ examine the Legend
Layer Controls window,
then click [OK]Once you have selected legend samples for vector
elements that are being rendered by a script, you canalso create a legend with these symbols in a map
layout for printing. Simply create a multi-object legend, use the Legend Layer Control window to add
the appropriate element type (point, line, or polygon) from the vector object, and the script-styled
legend samples and their labels appear automatically in the legend. The Legend Layer Controls window
allows you to adjust the positions of legend entries
and to change the label text and style if desired. The
tutorial booklet Making Map Layouts includes several exercises to guide you through the creation of amulti-object legend.
The print layout you open in this exercise includes a multi-object legend of geologic line
and point symbols rendered by CartoScript.
All of the script objects used are also included in the Project File.

page 36

Using CartoScripts

Scripting Legend Sample Position
Point and line symbols should be rendered in a printed
legend at the same scale as they are on the map. If
you have scaled your symbols to a map scale, they
will appear at the correct scale automatically in a
multi-object legend. But there are instances in which
you might want to have the script adjust the positionof samples both in LegendView and in a multi-object legend. The script variable DrawingSample isautomatically set to 1 whenever the script renders
either type of legend sample, allowing you to set up
instructions in the script to reposition symbols in thelegend sample.
The script in this exercise is a version of one shownin the earlier exercise Orienting Symbols by Attribute. It draws labeled arrows that in this case show
the trend and plunge of mineral lineations at various
map locations. In the map the base of the arrow is at
the outcrop location. The drawing instructions are modified when a legend sample
is being rendered to center the arrow on the
point and move it down a few pixels to better align vertically with the legend label.
The relevant portion of the script is excerpted below.

STEPS
þ in the Layout Controls
window, open the Vector
Layer Controls window
for the Lineation vector
layer in Group 1
þ click on the Points panelin the Vector Layer
Controls window andopen the Query Editor
window for point styles
þ note how legend
variables are used in thescriptþ click [OK] in the Query
Editor window and again
in the Vector Layer
Controls window# Draw arrow with zero line width, tip of stem at data point# but centered on point if legend sample
if (DrawingSample == 1) {LineStyleMoveTo(OppTrend, ArrowLength / 2);
LineStyleMoveTo(-90,5);}
LineStyleDropAnchor(0);# anchor at data point
LineStyleSetLineWidth(0);LineStyleDrawArrow(Direction, ArrowLength, HeadSize, Angle, 1);
LineStyleDropAnchor(1);# anchor at tip of arrow# Draw arrow stem with desired line width
LineStyleMoveToAnchor(0);LineStyleSetLineWidth(LineWidth);
LineStyleLineTo(Direction, StemLength);
LineStyleMoveToAnchor(1);page 37

Using CartoScripts

CartoScript Function List
Style Control Functions
LineStyleSetCapJoinType
LineStyleSetColorLineSyleSetCoordType
LineStyleSetFont
LineStyleSetLineWidth
LineStyleSetScale
LineStyleSetTextColor

set square or rounded ends for lines and polyline
segments
set RGB values (0-255) for line color
set coordinate type for input values (object or
millimeters)
set name of font to use for text
set width of lines to be drawn
set scale factor applied to input distances
set RGB values (0-255) for text color

Label Optimization
LineStyleAddToOptimizer

access built-in label placement optimizer

Functions that reference position within input line elements
Navigation
LineStyleNextVertex
LineStylePrevVertex
LineStyleRoll
LineStyleSetPosition

move pen to next vertex along line element
move pen to previous vertex along line
move pointer a specified distance along line
element
move pen to specified relative position alongline element (0.0 = start, 1.0 = end)

Drawing
LineStyleRollPen

move pen to pointer position and draw line for
specified distance along line element

Information
LineStyleGetDirection

find minimum and maximum direction angles
of line element segment
LineStyleGetDistanceTo
find distance from pointer position to next
vertex (1), previous vertex (2), end (3), or start(4) of line element
LineStyleGetLineCurvature find curvature of line element segment
LineStyleGetMaxDistancefind maximum perpendicular distance fromline segment to straight line connecting
segment start and end
LineStyleGetPosition
find current relative position of pointer alongline element (0.0 = start, 1.0 = end)
LineStyleIsClosed
test if current line element forms a closed
polygon (1) or not (0)Note: the line segment operated on by certain functions in the last group above
begins at the current pointer position along the line element and extends to a
specified distance from it.

page 38

Using CartoScripts

CartoScript Function List (continued)
Functions that reference the current local coordinate system
Navigation
LineStyleDropAnchor
LineStyleMoveTo
LineStyleMoveToAnchor

record current pen position as anchor
number for later use
move pen to location specified by direction
and distance from current pen location
move pen to specified anchor location

Drawing
draw arc
draw arrow to location specified by direction
and distance from current pen location
LineStyleDrawCircle
draw filled or unfilled circle
LineStyleDrawCone
draw cone
LineStyleDrawCube
draw cube
LineStyleDrawCylinder
draw cylinder
LineStyleDrawEllipse
draw filled or unfilled ellipse
LineStyleDrawPolygon
draw polygon connecting previously
recorded points
LineStyleDrawPolyline
draw polyline connecting previously
recorded points
LineStyleDrawRectangle
draw filled or unfilled rectangle
LineStyleDrawText
draw text label with specified text string
LineStyleDrawTextBox
draw boxed text label
LineStyleDrawThreePointArc draw arc connecting three points
LineStyleLineTodraw line to location specified by direction
and distance from current pen location
LineStyleLineToAnchor
draw line from current pen position to
specified anchor location
LineStyleRecordPolygon
start or stop recording polygon vertex
locations
LineStyleSideshot
specify sequence of positions by direction
and distance from current pen position andoptionally connect to form polyline
LineStyleTextNextPosition compute length and end position of text
string
LineStyleDrawArc
LineStyleDrawArrow

Functions that draw or transform entire input line elements
LineStyleDrawLine
LineStyleRestoreLine
LineStyleSpline
LineStyleThinLine

draw entire vector or CAD line element
restore original line coordinates
replace line element with splined line
replace line element with thinned line

page 39

Advanced Software for Geospatial Analysis

Using CartoScripts

MicroImages, Inc. publishes a complete line of professional software for advanced geospatial
data visualization, analysis, and publishing. Contact us or visit our web site for detailed product information.
TNTmips TNTmips is a professional system for fully integrated GIS, image analysis, CAD,
TIN, desktop cartography, and geospatial database management.
TNTedit TNTedit provides interactive tools to create, georeference, and edit vector,
image, CAD, TIN, and relational database project materials in a wide variety of formats.
TNTview TNTview has the same powerful display features as TNTmips and is perfect for
those who do not need the technical processing and preparation features of TNTmips.
TNTatlas TNTatlas lets you publish and distribute your spatial project materials on CDROM at low cost. TNTatlas CDs can be used on any popular computing platform.
TNTserver TNTserver lets you publish TNTatlases on the Internet or on your intranet.
Navigate through geodata atlases with your web browser and the TNTclient Java applet.
TNTliteTNTlite is a free version of TNTmips for students and professionals with small
projects. You can download TNTlite from MicroImages’ web site, or you can order
TNTlite on CD-ROM.

Index
anchors..........................................................5
contours..........................................20,30-31
coordinate type..........................................10
geologic maps......................3,14-15,29-31,36
labels.........................................................3,9
for contour lines............................30-31
manual positioning...............................13
optimizing placement......................16-19
legends....................................34-37
lines...................................................3,20-33
coordinate systems................................24
dashed................................................26
marking vertices.................................22
navigating..........................................21
position on......................................24-25
regularly spaced symbols...................23

point symbols........................................3-19
cone.....................................................8
cube.................................................8-10cylinder...........................................8,11
ellipse..................................................6
flag....................................................4-7
geometric shapes.............................6,8
orientation by attribute....................23-24
rectangle..............................................6
polygon........................................................7
polyline..................................................7
queries......................................................3
strike / dip symbol.................................14-15
syncline...........................................32-33
syntax.................................................3

M icro Im a g es, In c.
11th Floor - Sharp Tower
206 South 13th Street
Lincoln, Nebraska 68508-2010 USA
Voice: (402) 477-9554
FAX: (402) 477-9559

page 40

email: info@microimages.com
internet: www.microimages.com

C
A
R
T
O
S
C
R
I
P
T
S