source: geovis/trunk/geovis_protocol.txt @ 5105

Last change on this file since 5105 was 5105, checked in by ldelgass, 5 years ago

geovis updates for NSF demo

File size: 10.4 KB
3Protocol for geovis render server. 
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.
22When binary data is to be sent, it should follow the newline after a command
23that indicates incoming data including a byte count argument.
29== General scene and renderer commands ==
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)
74clientinfo <list>
76colormap add <colorMapName> <colorMap>
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 a} control points
80colormap define <colorMapName> <colorMap>
81         (Re-)define a colormap (same as 'add')
82colormap delete <?colorMapName?>
83colormap res <numberOfTableEntries>
84         Set the "resolution" or number of lookup table entries in the colormap
85         <numberOfTableEntries> = integer or "default"
87renderer render
88         Force a new image to be rendered
90screen bgcolor <r> <g> <b>
91screen coords <token> <coordList> <?srs?> <?verticalDatum?>
92       Transate map coordinates to screen/mouse coordinates.
93       <token> - String token, included in response
94       <coordList> - A list of x,y,z map coordinates.  If <srs> is not given,
95       these are in the map's coordinate system.
96       <srs> - Optional horizontal srs init string for coordinate system of
97       x,y,z
98       <verticalDatum> - Optional vertical srs init string for coordinate system
99       of x,y,z
100screen size <width> <height>
102== Mouse and Keyboard Events ==
104key press <key>
105key release <key>
107mouse click <button> <x> <y>
108mouse dblclick <button> <x> <y>
109mouse drag <button> <x> <y>
110mouse motion <x> <y>
111mouse release <button> <x> <y>
112mouse scroll <direction>
114== Map Commands ==
116map attrib <string>
117    <string> - Attribution/copyright to display in corner of map
119map coords <token> <coordList> <?srs?> <?verticalDatum?>
120    Translate screen/mouse coordinates into map coordinates.
121    <token> - String token, included in response
122    <coordList> - A list of x,y screen/mouse coordinates
123    <srs> - Optional horizontal srs init string for coordinate system to return
124    <verticalDatum> - Optional vertical srs init string for coordinate system to
125    return
127map grid <bool> <?type?>
128    Toggle graticule and set type
129    <type> = geodetic|utm|mgrs
131General form:
132map layer add <type> <driver> <url> ... <layerName>
133    <type> = image|elevation|line|point|polygon|text
134    <driver> = gdal|tms|wms|xyz
136Specific image layer types:
137map layer add image gdal <url> <cache> <layerName>
138    Add a GDAL image layer from a file or URL
139map layer add image wms <url> <cache> <layers> <format> <transparent> <layerName>
140    Add a WMS image layer from a URL + layer string
141    <url> = URL of WMS service
142    <cache> = bool indicating if tiles should be cached on disk
143    <layers> = layers string for WMS server
144    <format> = Image format to return (e.g. 'png')
145    <transparent> = bool
146map layer add image tms <url> <cache> <layerName>
147    Add a TMS image layer from a URL
148    <url> = URL of TMS service
149    <cache> = bool indicating if tiles should be cached on disk
150map layer add image xyz <urlPattern> <cache> <layerName>
151    Add an image layer from a web map using a template URL
152    <cache> = bool indicating if tiles should be cached on disk
154Elevation layers:
155map layer add elevation <driver> <url> <layerName>
156    Add an elevation image layer from a file or URL
157    <driver> = gdal|tms|wms
159Feature/model layers:
160map layer add point <url> <r> <g> <b> <size> <layerName>
161    Add a point feature layer from a file or URL
162map layer add polygon <url> <r> <g> <b> <width> <layerName>
163    Add a polygon feature layer from a file or URL
164map layer add line <url> <r> <g> <b> <width> <layerName>
165    Add a line feature layer from a file or URL
166map layer add text <url> <layerName>
167    Add a text symbol layer from a file or URL
169map layer delete <layerName>
170map layer opacity <opacity> <layerName>
171map layer move <pos> <layerName>
172map layer visible <bool> <layerName>
174map load data follows <nbytes>
175    Send an .earth file over the wire
176map load file <path>
177    Load an .earth file from a filesystem mounted on the server
178map load url <url>
179    Load an .earth file from a network address
181map posdisp <bool> <?format?> <?precision?>
182    Toggle coordinate/position display, set format and precision
183    <format> = latlong_decimal_degrees|latlong_degrees_decimal_minutes|
184               latlong_degrees_minutes_seconds|mgrs
185    <precision> = integer number of digits to display
187map reset <type> <?profile?> <?xmin?> <?ymin?> <?xmax?> <?ymax?>
188    Clear the scene and rebuild a new map from scratch.  When resetting the
189    map to geocentric, a profile and extents should be omitted.  When the map
190    type is projected, the profile is required and extents are optional.
191    type = geocentric|projected
192    profile = Well known profile string, e.g. 'global-geodetic',
193    'global-mercator'.  If specifying bounds (i.e. not global), use 'geodetic'
194    or 'spherical-mercator' or an SRS init string (such as an EPSG code)
195    xmin,ymin,xmax,ymax = map bounds (in profile projection/units)
197map scalebar <bool> <?units?>
198    Toggle scale label/bar
199    <units> = meters|feet|us_survey_feet|nautical_miles
200map setpos <x> <y>
201    Set the coordinate/position display based on mouse coordinates
202map terrain edges <bool>
203    *Not currently implemented*
204map terrain lighting <bool>
205map terrain linecolor <r> <g> <b>
206    *Not currently implemented*
207map terrain vertscale <val>
208    Set scale factor for terrain height
209map terrain wireframe <bool>
210map time <?hours?> <?day?> <?month?> <?year?>
211    Set ephemeris time for sky.  When args are omitted, set to current time.
212    Time is interpreted as UTC.
217nv>image -type image -bytes <nbytes>
218  <binary RGB data>
219nv>legend <colormapName> <rmin> <rmax> <nbytes>
220  <binary RGB data>
221nv>map coords <token> <mapCoordList> <?srs?> <?verticalDatum?>
222   Reply to query of map coordinates from screen coordinates.  The mapCoordList
223   is a list of x,y,z map coordinates.  The srs of the map coordinates may be
224   included if not in map's native coordinate system.  NaN in the results
225   indicates off-map input coordinates.
226nv>screen coords <token> <screenCoordList>
227   Reply to query of screen coordinates from map coordinates.  The
228   screenCoordList is a list of x,y,z screen coordinates (z is the depth).  NaN
229   in the results indicates a point outside the view frustum or invalid input
230   map coordinate
231nv>ok -token <seqnum>
232   Reply indicated commands through <seqnum> (numbered beginning at 0) have been
233   processed, but no new image was rendered
235Error Replies:
237nv>viserror -bytes <nbytes>
238   <multi-line error string of nbytes>
Note: See TracBrowser for help on using the repository browser.