source: trunk/packages/vizservers/geovis/geovis_protocol.txt @ 4350

Last change on this file since 4350 was 4350, checked in by ldelgass, 7 years ago

Doc updates

File size: 8.7 KB
Line 
1================================================================================
2================================================================================
3Protocol for geovis render server. 
4
5Commands take the general form of command and arguments using Tcl syntax and are
6terminated by a newline.  Some command arguments expect a Tcl list which can be
7sent by enclosing the list in curly braces to prevent the interpreter from
8splitting the list into multiple arguments.  Likewise, strings with spaces
9should be quoted or enclosed in curly braces.  In the documentation below,
10arguments are indicated by angle brackets and optional arguments are surrounded
11by question marks -- the brackets and question marks are not part of the
12protocol and should not be included in argument strings.  The arguments shown
13in angle brackets should be replaced with a string (where there are fixed
14choices this document indicates valid values by separating them with pipe
15symbols), a list in Tcl syntax, or a numeric value.  Boolean arguments can take
16the form of 0|1, true|false, or yes|no.  Since the protocol commands are
17executed in a Tcl interpreter, Tcl code such as math expressions in expr
18commands enclosed in square brackets are also allowed.  Since the interpreter
19is a "safe" interpreter, some Tcl commands that could cause security issues may
20not be available for use.
21
22When binary data is to be sent, it should follow the newline after a command
23that indicates incoming data including a byte count argument.
24================================================================================
25================================================================================
26Requests:
27================================================================================
28
29== General scene and renderer commands ==
30
31camera delete <name>
32       Delete named viewpoint
33camera dist <distance>
34       Set camera distance from focal point
35camera get
36       Request camera parameters
37camera go <x> <y> <?zoomFactor?> <?duration?>
38       Move camera to new focal point.
39       <x>,<y> = Screen/mouse coordinates
40       <zoomFactor> = Zoom distance multiplier, 1.0=no zoom
41       <duration> = Duration of viewpoint move animation in seconds
42camera orient <quatW> <quatX> <quatY> <quatZ>
43       Set scene orientation using a quaternion
44camera pan <x> <y>
45       <x,y> viewport coordinates (window center at 0,0).  Positive x pan
46       means pan object to right (camera to left).  Positive y pan means
47       pan object down (camera up).  For example a pan of 0.5, 0.5 would
48       move the object center to the lower right corner of the window
49camera reset <?all?>
50       Option all resets orientation/rotation as well as pan/zoom/clip range
51camera restore <name> <?duration?>
52       Set viewpoint to a named viewpoint, with optional animation duration in
53       seconds
54camera rotate <x> <y>
55       Specify relative rotation in viewport coordinates
56camera save <name>
57       Save current viewpoint to a named viewpoint
58camera set <x> <y> <z> <heading> <pitch> <distance> <?duration?> <?srs?> <?vertDatum?>
59       Explicitly set camera parameters, with optional animation duration in
60       seconds
61       <x>, <y> = Map coordinates of focal point
62       <z> = Altitude of focal point (see vertDatum)
63       <heading> = Azimuth in degrees
64       <pitch> = Elevation in degrees
65       <distance> = Distance of camera from focal point in map units(?)
66       <srs> = coordinate system, defaults to map coordinate system
67       <vertDatum> = vertical datum for interpreting z coordinate
68camera throw <bool>
69       Enable/disable throw inertia for panning/rotating when using mouse events
70       through protocol
71camera zoom <y>
72       Specify zoom by viewport coordinates (i.e. normalized y mouse coords)
73
74clientinfo <list>
75
76colormap add <colorMapName> <colorMap> <opacityMap>
77         (Re-)define a colormap.  If colorMapName doesn't exist, it is created,
78         otherwise the colormap is redefined and all users will be updated.
79         colorMap = Tcl list of {value r g b} control points
80         opacityMap = Tcl list of {value alpha} control points
81colormap define <colorMapName> <colorMap> <opacityMap>
82         (Re-)define a colormap (same as 'add')
83colormap delete <?colorMapName?>
84colormap res <numberOfTableEntries>
85         Set the "resolution" or number of lookup table entries in the colormap
86         <numberOfTableEntries> = integer or "default"
87
88renderer render
89         Force a new image to be rendered
90
91screen bgcolor <r> <g> <b>
92screen size <width> <height>
93
94== Mouse and Keyboard Events ==
95
96key press <key>
97key release <key>
98
99mouse click <button> <x> <y>
100mouse dblclick <button> <x> <y>
101mouse drag <button> <x> <y>
102mouse motion <x> <y>
103mouse release <button> <x> <y>
104mouse scroll <direction>
105
106== Map Commands ==
107
108map coords <x> <y>
109    Translate screen/mouse coordinates into map coordinates
110
111map grid <bool> <?type?>
112    Toggle graticule and set type
113    <type> = geodetic|utm|mgrs
114
115General form:
116map layer add <type> <driver> <url> ... <layerName>
117    <type> = image|elevation|line|point|polygon|text
118    <driver> = gdal|tms|wms|xyz
119
120Specific image layer types:
121map layer add image gdal <url> <layerName>
122    Add a GDAL image layer from a file or URL
123map layer add image wms <url> <layers> <format> <transparent> <layerName>
124    Add a WMS image layer from a URL + layer string
125    <url> = URL of WMS service
126    <layers> = layers string for WMS server
127    <format> = Image format to return (e.g. 'png')
128    <transparent> = bool
129map layer add image tms <url> <layerName>
130    Add a TMS image layer from a URL
131    <url> = URL of TMS service
132map layer add image xyz <urlPattern> <layerName>
133    Add an image layer from a web map using a template URL
134
135Elevation layers:
136map layer add elevation <driver> <url> <layerName>
137    Add an elevation image layer from a file or URL
138    <driver> = gdal|tms|wms
139
140Feature/model layers:
141map layer add point <url> <layerName>
142    Add a point feature layer from a file or URL
143map layer add polygon <url> <layerName>
144    Add a polygon feature layer from a file or URL
145map layer add line <url> <layerName>
146    Add a line feature layer from a file or URL
147map layer add text <url> <layerName>
148    Add a text symbol layer from a file or URL
149
150map layer delete <layerName>
151map layer opacity <opacity> <layerName>
152map layer move <pos> <layerName>
153map layer visible <bool> <layerName>
154
155map load data follows <nbytes>
156    Send an .earth file over the wire
157map load file <path>
158    Load an .earth file from a filesystem mounted on the server
159map load url <url>
160    Load an .earth file from a network address
161
162map posdisp <bool> <?format?> <?precision?>
163    Toggle coordinate/position display, set format and precision
164    <format> = latlong_decimal_degrees|latlong_degrees_decimal_minutes|
165               latlong_degrees_minutes_seconds|mgrs
166    <precision> = integer number of digits to display
167
168map reset <type> <?profile?> <?xmin?> <?ymin?> <?xmax?> <?ymax?>
169    Clear the scene and rebuild a new map from scratch.  When resetting the
170    map to geocentric, a profile and extents should be omitted.  When the map
171    type is projected, the profile is required and extents are optional.
172    type = geocentric|projected
173    profile = Well known profile string, e.g. 'global-geodetic',
174    'global-mercator'.  If specifying bounds (i.e. not global), use 'geodetic'
175    or 'spherical-mercator' or an SRS init string (such as an EPSG code)
176    xmin,ymin,xmax,ymax = map bounds (in profile projection/units)
177
178map scalebar <bool> <?units?>
179    Toggle scale label/bar
180    <units> = meters|feet|us_survey_feet|nautical_miles
181map setpos <x> <y>
182    Set the coordinate/position display based on mouse coordinates
183map terrain edges <bool>
184    *Not currently implemented*
185map terrain lighting <bool>
186map terrain linecolor <r> <g> <b>
187    *Not currently implemented*
188map terrain vertscale <val>
189    Set scale factor for terrain height
190map terrain wireframe <bool>
191
192================================================================================
193Replies:
194================================================================================
195nv>image -type image -bytes <nbytes>
196  <binary RGB data>
197nv>map coords <x> <y> <z> <?mouseX?> <?mouseY?>
198   Reply to query of map coordinates.  If reply is to a request with mouse
199   coordinates, the mouse coordinates are included.
200nv>map coords invalid <mouseX> <mouseY>
201   Reply indicating an off-map click/query
202nv>ok -token <seqnum>
203   Reply indicated commands through <seqnum> (numbered beginning at 1) have been
204   processed, but no new image was rendered
205================================================================================
206Error Replies:
207================================================================================
208nv>viserror -bytes <nbytes>
209   <multi-line error string of nbytes>
210================================================================================
Note: See TracBrowser for help on using the repository browser.