资源描述
此文档收集于网络,如有侵权请联系网站删除
1 Common Calling Conventions 3
1.1 Passing Null to Represent a Default Value 4
1.2 Identifying Maps, Layers, and Selection Sets 4
1.3 Identifying Views and Sets 5
1.3 Identifying Fonts 5
1.4 Identifying Windows 6
1.5 Identifying Fields 6
1.6 Using Boolean Values 6
1.7 Using Options Arrays 6
2 Using GISDK Functions 7
2.1 Windows 8
2.1.1 Creating Windows 9
2.1.2 Working with Windows 10
2.1.3 Closing Windows 11
2.1.4 Attaching Menus and Toolbars 12
2.1.5 Window Macros 12
2.1.6 Window Macros - An Example 13
2.1.7 Saving and Loading Windows 15
2.2 Maps 17
2.2.1 Creating Maps 18
2.2.2 Maps and Layers 21
2.2.3 Layer Styles and Settings 26
2.2.4 User Interaction 31
2.2.5 Themes 32
2.2.6 Freehand Items (Annotations) 37
2.2.7 Selection Sets 38
2.2.8 Legends 40
2.3 Geographic Data and Analysis 41
2.3.1 Feature Coordinates 41
2.3.2 Adding, Editing, and Deleting Features 42
2.3.3 Importing and Exporting Geographic Data 42
2.3.4 Working with Geographic Files 43
2.3.5 Spatial Analysis 44
2.3.6 Triangulated Irregular Networks (TINs) 46
2.4 Tables, Views, and Editors 46
2.4.1 Tables and Views 47
2.4.2 Editors 49
2.4.3 Views, Layers, and Joined Views 52
2.4.4 Reading and Writing Data 57
2.4.5 Reading and Writing from Several Views 64
2.4.6 Adding or Deleting Records 65
2.4.7 Creating and Modifying Tables 66
2.4.8 ODBC and Oracle Tables 66
2.5 Networks 67
2.5.1 Creating and Manipulating Networks 68
2.5.2 Reading Information from a Network 70
2.5.3 Networks and Network Settings 71
2.5.4 Selecting Segments 72
2.5.5 Updating a Network 72
2.5.6 Solving Shortest Paths 73
2.6 Route Systems 75
2.6.1 Creating and Maintaining Route Systems 76
2.6.2 Adding, Editing and Deleting Routes 76
2.6.3 Getting Information About Routes and Stops 77
2.6.4 Utility Functions for Developing Routes 77
2.6.5 Route Display Settings 77
2.6.6 Mileposts and Milepost Layers 78
2.7 Matrices 78
7.1 Creating and Managing Matrices 79
7.2 Working with Matrix Editors 84
7.3 Reading and Writing Matrix Data 85
7.4 Working with Matrices 87
7.5 User Interface Programming 88
7.6 Math, String, and Array Manipulation 94
7.7 Timers and Stopwatches 97
7.8 Slide Shows & Snapshots 98
7.9 Printing & Layouts 99
7.10 Interprocess Communication 101
3Using Projections and Coordinate Systems 102
Calling GISDK Functions
There are hundreds of GISDK functions that you can use to create maps, perform spatial analysis, and build custom applications. This section describes the common calling conventions, summarizes the GISDK functions by topic, and describes them in detail alphabetically. There is also a discussion of how to use projections and coordinate systems.
For more information, see...
Common Calling Conventions
Using GISDK Functions
Using Projections and Coordinate Systems
Listing of GISDK Functions
1 Common Calling Conventions
This part of the on-line help identifies some common calling conventions that are shared by many GISDK functions.
Function names begin with a verb, except:
· Some functions that would begin with Create and that return the named object have the Create dropped; for example, what would be CreateCircle() is just Circle()
· Functions that would begin with Convert or Compute have that dropped as well; for example, what would be ConvertRealToInt() is just RealToInt()
· Boolean functions take the form of a declaration rather than a command, such as CoordInMap()
In addition, the following abbreviations are used:
Term
Abbreviation
Integer
Int
Geography
Geo
Minimum
Min
Maximum
Max
Database
DB (for geographic files only)
Dialog Box
Dbox
Description
Desc
Information
Info
For more information, see...
Passing Null to Represent a Default Value
Identifying Maps, Layers, and Selection Sets
Identifying Views and Sets
Identifying Fonts
Identifying Windows
Identifying Fields
Using Boolean Values
Using Options Arrays
1.1 Passing Null to Represent a Default Value
Many GISDK functions interpret a null value for an argument to indicate that a default value should be used. For example, most GISDK functions that take a map name as an argument interpret null to mean the current map. The same applies to GISDK functions that take an editor name, a layout name, or a layer name. GISDK functions that affect display characteristics interpret null to mean "no change." For example, calling SetIconColor() on a selection set with a null value for the color indicates that the color of features in the set should not be changed from the default for the layer.
1.2 Identifying Maps, Layers, and Selection Sets
GISDK functions that change layer styles accept several types of strings that identify the map, layer, and selection set to be modified. These strings use a vertical bar to separate the different parts of the string. Any of the following is acceptable:
Syntax...
What it means...
mapname|layername|setname
Modify the style of features in the named map, layer, and selection set
layername|setname
Modify the style of features in the named layer and selection set in the current map
setname
Modify the style of features in the named selection set for the current layer in the current map
layername|
Modify the style of features in the named layer in the current map
null
Modify the style of features in the current layer in the current map
A similar set of options is available for setting the style of a theme class. The following are acceptable:
Syntax...
What it means...
layername|themename|class_id
Modify the style of features in the named layer, theme and class
themename|class_id
Modify the style of features in the named theme and class on the current layer
Some display characteristics affect an entire layer and cannot be used on individual selection sets. For example, SetLayerVisibility() determines whether a layer is drawn in a map or not. For layer-wide display GISDK functions, you specify the map and layer you are changing in one of three ways:
Syntax...
What it means...
mapname|layername
Modify the named layer in the named map
layername
Modify the named layer in the current map
null
Modify the current layer in the current map
1.3 Identifying Views and Sets
Many GISDK functions work with views and sets. For example, GetFirstRecord() gets the first record in a particular set in a particular view. You specify which view and set you are using with a string that can have one of four formats:
Syntax...
What it means...
viewname|setname
The named view and selection set
setname
The named selection set in the current view
viewname|
All records in the named view
null
All records in the current view
1.3 Identifying Fonts
Some GISDK functions require a font as an argument. In Caliper Script, a font specification is a string of the form:
font_family_name|font_size
font_family_name|Bold|font_size
font_family_name|Italic|font_size
font_family_name|Bold|Italic|font_size
Font sizes are expressed in points and can be real numbers, as in "Times New Roman|Bold|17.5." Font family names must exactly match the names returned by GetFontNames().
1.4 Identifying Windows
When you call a GISDK function that can be used on all types of windows (e.g., MinimizeWindow()), you must specify the window type as well as the window name, as in "Map|My First Map" or "Editor|Sales Data". To use one of these GISDK functions with the TransCAD program window, call the GISDK function with "Frame|" as the argument (e.g., MaximizeWindow("Frame|")).
1.5 Identifying Fields
As described in more detail in Tables and Views, GISDK uses both field names and field specs (specifications) to identify fields in a view. Some GISDK functions require field names, while others require field specs. In general, GISDK functions that operate on a single view (e.g., GetFirstRecord()) take field names. GISDK functions that operate on a layer (e.g., CreateTheme()) or on any view (e.g., JoinViews()) take field specs. Refer to the documentation of an individual GISDK function to determine whether it takes field names or field specs.
1.6 Using Boolean Values
Many GISDK functions take boolean values (True or False) as arguments. Others return boolean values. When passing a boolean value to a GISDK function, either as a parameter or as the value of an option, pass a string containing the word "True" or "False." In general, a GISDK function that returns a boolean value returns a string, either "True" or "False," but there are some GISDK functions that return a different value, such as "On" or "Off." Refer to the documentation for an individual GISDK function to determine its possible return values.
1.7 Using Options Arrays
Many GISDK functions take an array of options as a parameter. Each element in an options array is an array of two (or more) elements. The first element in each sub-array is a string specifying the name of the option. The second (and subsequent) elements of a sub-array give the values for the option. For example, the following options array contains two options (Layer Name and Label) and their associated values:
options_array = {
{"Layer Name", "Counties"}
{"Label", "Counties of the Northeast"}
}
You can use a dot notation to get, set, add, and remove options in options arrays. For more information, see "Options Arrays and Dot Notation" in Arrays.
If you don't need to pass any options to a GISDK function, you can pass null for the options array.
Some GISDK functions also return options arrays. In general, you should not rely on the order in which options appear in a returned options array. Instead, to locate specific options within an options array, use the GISDK functions:
GISDK Function
Summary
FindOption()
Finds a particular option and its setting in an array of name-value pairs
FindOptionValue()
Finds the value of a particular option in an options array
In addition, some GISDK functions, like AddAnnotation() and GetAnnotation() accept or return information in the same format as an options array. You can use these same GISDK functions to manipulate these arrays.
2 Using GISDK Functions
This section contains overviews of how you use GISDK functions to work with windows, maps, layers, editors, tables, and views, well as overviews GISDK functions for geographic data and analysis, networks, routes systems, matrices, and other tasks. Also addressed are the key differences between the terminology used in TransCAD and the terminology used in GISDK.
For more information, see...
Windows
Maps
Geographic Data and Analysis
Tables and Views
Networks
Route Systems
Matrices
Other GISDK Functions
2.1 Windows
GISDK lets you create, manipulate, and close windows of five different types. You can control the location, size, and other settings for each window, save the contents of a window to a file, or open a file and create a window from its contents.
You can also attach menus and toolbars to each and every window, and create macros that run automatically either when a user clicks in a window to activate it, or when a user closes the window. These capabilities let you separately customize the interface for each window in your application. The Standard Interface, however, has only one menu system for all windows, and only one toolbar for each window type.
GISDK supports five types of windows: maps, editors (including dataviews), figures, layouts, and a special type of window called the frame. The frame is the TransCAD program window as it appears when no maps, editors, figures, or layouts are open.
Every map, editor, figure, and layout has a name that distinguishes it from all other windows of the same type. For example, your application could have six different windows as shown in the table:
Window
Type
Name
1
Map
US Streets
2
Map
States
3
Map
US Streets:1
4
Editor
US Streets
5
Editor
State Data
6
Layout
Untitled
No two maps, editors, figures, or layouts can have the same name, although as indicated in the above example, a window of one type can have the same name as a window of another type. The windows in GISDK are also identified by name, where the window name is of the form "window type|window name". For example, "Map|US Streets", "Editor|State Data", and "Layout|Untitled" are all valid window names in the above example.
Most window management GISDK functions can accept a null value for the window name. In this case, GISDK applies the function to the most recently activated map, editor, figure, or layout window. In addition, GISDK functions that work on only one type of window (e.g., CloseMap()) take the window name without the window type.
For more information, see...
Creating Windows
Working with Windows
Closing Windows
Controlling Window Size and Location
Attaching Menus and Toolbars
Window Macros
Saving and Loading Windows
2.1.1 Creating Windows
Windows are created by the following GISDK functions:
GISDK Function
Summary
CreateMap()
Creates a new, empty map window
CreateEditor()
Creates a new editor window
CreateEditorByQuery()
Creates an editor displaying the results of an SQL query
CreateMatrixEditor()
Creates a new matrix editor window
CreateFigure()
Creates a new figure window
CreateLayout()
Creates a new layout window
OpenMap()
Opens a map file and displays it in a map window
OpenMapFromAnnotation()
Creates a new map window from a map that appears in a layout
OpenEditor()
Creates an editor from a file
OpenEditorFromAnnotation()
Creates a new editor window from an editor that appears in a layout
OpenFigure()
Creates a figure from a file
OpenFigureFromAnnotation()
Creates a new figure window from a figure that appears in a layout
OpenLayout()
Creates a layout from a file
These GISDK functions all return the name of the map, editor, figure, or layout window that was created. These GISDK functions have numerous options that control how the window operates. Here is a quick summary:
Option
What it does
Menu
Names the menu that is associated with the window
Toolbar
Names the toolbar that is associated with the window
Position
Sets the location of the upper-left corner of the window within the application window
Size
Sets the size of the window within the application window
Activate Macro
Specifies the name of a macro that is run automatically when the window is activated
Close Macro
Specifies the name of a macro that is run automatically when the user closes the window by choosing the Close option from the System menu
Some of these options can be changed after a particular window is created. These options are described in detail in the topics that follow. The following GISDK functions are used to manage window options:
GISDK Function
What it does
GetMapOptions()
Gets the value of options for a map window
SetMapOptions()
S
展开阅读全文