1 | ================================================================================ |
---|
2 | ================================================================================ |
---|
3 | Protocol for geovis render server. |
---|
4 | |
---|
5 | Commands take the general form of command and arguments using Tcl syntax and are |
---|
6 | terminated by a newline. Some command arguments expect a Tcl list which can be |
---|
7 | sent by enclosing the list in curly braces to prevent the interpreter from |
---|
8 | splitting the list into multiple arguments. Likewise, strings with spaces |
---|
9 | should be quoted or enclosed in curly braces. In the documentation below, |
---|
10 | arguments are indicated by angle brackets and optional arguments are surrounded |
---|
11 | by question marks -- the brackets and question marks are not part of the |
---|
12 | protocol and should not be included in argument strings. The arguments shown |
---|
13 | in angle brackets should be replaced with a string (where there are fixed |
---|
14 | choices this document indicates valid values by separating them with pipe |
---|
15 | symbols), a list in Tcl syntax, or a numeric value. Boolean arguments can take |
---|
16 | the form of 0|1, true|false, or yes|no. Since the protocol commands are |
---|
17 | executed in a Tcl interpreter, Tcl code such as math expressions in expr |
---|
18 | commands enclosed in square brackets are also allowed. Since the interpreter |
---|
19 | is a "safe" interpreter, some Tcl commands that could cause security issues may |
---|
20 | not be available for use. |
---|
21 | |
---|
22 | When binary data is to be sent, it should follow the newline after a command |
---|
23 | that indicates incoming data including a byte count argument. |
---|
24 | ================================================================================ |
---|
25 | ================================================================================ |
---|
26 | Requests: |
---|
27 | ================================================================================ |
---|
28 | |
---|
29 | == General scene and renderer commands == |
---|
30 | |
---|
31 | camera delete <name> |
---|
32 | Delete named viewpoint |
---|
33 | camera dist <distance> |
---|
34 | Set camera distance from focal point |
---|
35 | camera extent <xmin> <ymin> <xmax> <ymax> <?duration?> <?srs?> |
---|
36 | Zoom to extent. Will fit the extent to the vertical FOV and center on |
---|
37 | the extent centroid. |
---|
38 | <xmin>,<ymin>,<xmax>,<ymax> = extent bounds in the specified SRS, |
---|
39 | or in the map's SRS if none is specified. |
---|
40 | <duration> = Duration of viewpoint move animation in seconds |
---|
41 | <srs> = The SRS of the extent bounds |
---|
42 | camera get |
---|
43 | Request camera parameters |
---|
44 | camera go <x> <y> <?zoomFactor?> <?duration?> |
---|
45 | Move camera to new focal point. |
---|
46 | <x>,<y> = Screen/mouse coordinates |
---|
47 | <zoomFactor> = Zoom distance multiplier, 1.0=no zoom |
---|
48 | <duration> = Duration of viewpoint move animation in seconds |
---|
49 | camera lextent <layerName> <?duration?> |
---|
50 | Zoom to layer extent. Will fit the extent to the vertical FOV and center |
---|
51 | on the extent centroid. |
---|
52 | <layerName> = Name of layer to use for extent. |
---|
53 | <duration> = Duration of viewpoint move animation in seconds |
---|
54 | camera orient <quatW> <quatX> <quatY> <quatZ> |
---|
55 | Set scene orientation using a quaternion |
---|
56 | camera pan <x> <y> |
---|
57 | <x,y> viewport coordinates (window center at 0,0). Positive x pan |
---|
58 | means pan object to right (camera to left). Positive y pan means |
---|
59 | pan object down (camera up). For example a pan of 0.5, 0.5 would |
---|
60 | move the object center to the lower right corner of the window |
---|
61 | camera reset <?all?> |
---|
62 | Option all resets orientation/rotation as well as pan/zoom/clip range |
---|
63 | camera restore <name> <?duration?> |
---|
64 | Set viewpoint to a named viewpoint, with optional animation duration in |
---|
65 | seconds |
---|
66 | camera rotate <x> <y> |
---|
67 | Specify relative rotation in viewport coordinates |
---|
68 | camera save <name> |
---|
69 | Save current viewpoint to a named viewpoint |
---|
70 | camera set <x> <y> <z> <heading> <pitch> <distance> <?duration?> <?srs?> <?vertDatum?> |
---|
71 | Explicitly set camera parameters, with optional animation duration in |
---|
72 | seconds |
---|
73 | <x>, <y> = Map coordinates of focal point |
---|
74 | <z> = Altitude of focal point (see vertDatum) |
---|
75 | <heading> = Azimuth in degrees |
---|
76 | <pitch> = Elevation in degrees |
---|
77 | <distance> = Distance of camera from focal point in map units(?) |
---|
78 | <srs> = coordinate system, defaults to map coordinate system |
---|
79 | <vertDatum> = vertical datum for interpreting z coordinate |
---|
80 | camera throw <bool> |
---|
81 | Enable/disable throw inertia for panning/rotating when using mouse events |
---|
82 | through protocol |
---|
83 | camera zoom <y> |
---|
84 | Specify zoom by viewport coordinates (i.e. normalized y mouse coords) |
---|
85 | |
---|
86 | clientinfo <list> |
---|
87 | |
---|
88 | colormap add <colorMapName> <colorMap> |
---|
89 | (Re-)define a colormap. If colorMapName doesn't exist, it is created, |
---|
90 | otherwise the colormap is redefined and all users will be updated. |
---|
91 | colorMap = Tcl list of {value r g b a} control points |
---|
92 | colormap define <colorMapName> <colorMap> |
---|
93 | (Re-)define a colormap (same as 'add') |
---|
94 | colormap delete <?colorMapName?> |
---|
95 | colormap res <numberOfTableEntries> |
---|
96 | Set the "resolution" or number of lookup table entries in the colormap |
---|
97 | <numberOfTableEntries> = integer or "default" |
---|
98 | |
---|
99 | legend <colormapName> <w> <h> <?opaque?> <?bgR?> <?bgG?> <?bgB?> |
---|
100 | Render a legend colorbar. |
---|
101 | <colormapName> - Name of the colormap defined with the colormap command |
---|
102 | <w>,<h> - width and height of colorbar |
---|
103 | <opaque> - If false, blend with background color |
---|
104 | <bgR>,<bgG>,<bgB> - Background color (defaults to black) |
---|
105 | |
---|
106 | renderer render |
---|
107 | Force a new image to be rendered |
---|
108 | |
---|
109 | screen bgcolor <r> <g> <b> |
---|
110 | screen coords <token> <coordList> <?srs?> <?verticalDatum?> |
---|
111 | Transate map coordinates to screen/mouse coordinates. |
---|
112 | <token> - String token, included in response |
---|
113 | <coordList> - A list of x,y,z map coordinates. If <srs> is not given, |
---|
114 | these are in the map's coordinate system. |
---|
115 | <srs> - Optional horizontal srs init string for coordinate system of |
---|
116 | x,y,z |
---|
117 | <verticalDatum> - Optional vertical srs init string for coordinate system |
---|
118 | of x,y,z |
---|
119 | screen size <width> <height> |
---|
120 | |
---|
121 | == Mouse and Keyboard Events == |
---|
122 | |
---|
123 | key press <key> |
---|
124 | key release <key> |
---|
125 | |
---|
126 | mouse click <button> <x> <y> |
---|
127 | mouse dblclick <button> <x> <y> |
---|
128 | mouse drag <button> <x> <y> |
---|
129 | mouse motion <x> <y> |
---|
130 | mouse release <button> <x> <y> |
---|
131 | mouse scroll <direction> |
---|
132 | |
---|
133 | == Map Commands == |
---|
134 | |
---|
135 | map attrib <string> |
---|
136 | <string> - Attribution/copyright to display in corner of map |
---|
137 | |
---|
138 | map coords <token> <coordList> <?srs?> <?verticalDatum?> |
---|
139 | Translate screen/mouse coordinates into map coordinates. |
---|
140 | <token> - String token, included in response |
---|
141 | <coordList> - A list of x,y screen/mouse coordinates |
---|
142 | <srs> - Optional horizontal srs init string for coordinate system to return |
---|
143 | <verticalDatum> - Optional vertical srs init string for coordinate system to |
---|
144 | return |
---|
145 | |
---|
146 | map grid <bool> <?type?> |
---|
147 | Toggle graticule and set type |
---|
148 | <type> = geodetic|utm|mgrs |
---|
149 | |
---|
150 | General form: |
---|
151 | map layer add <layerName> <type> <driver> <?url?> <?cache?> ... |
---|
152 | <type> = image|elevation|icon|line|point|polygon|text |
---|
153 | <driver> = arcgis|colorramp|debug|gdal|ogr|tfs|tms|wfs|wms|xyz |
---|
154 | <cache> = bool indicating if tiles should be cached on disk |
---|
155 | |
---|
156 | Specific image layer types: |
---|
157 | map layer add <layerName> image colorramp <url> <cache> <coverage> <elevdriver> <profile> <colormapName> |
---|
158 | Add a colormapped image layer from a file or URL |
---|
159 | <url> = URL of source |
---|
160 | <cache> = bool indicating if tiles should be cached on disk |
---|
161 | <coverage> = bool indicating if data should not be interpolated (true means |
---|
162 | no interpolation) |
---|
163 | <elevdriver> = Elevation driver to read source |
---|
164 | <profile> = profile of source |
---|
165 | <colormapName> = Name of colormap |
---|
166 | map layer add <layerName> image arcgis <url> <?cache?> <?coverage?> <?token?> <?layers?> |
---|
167 | Add an ArcGIS MapServer image layer from a URL |
---|
168 | <url> = URL of source |
---|
169 | <cache> = bool indicating if tiles should be cached on disk |
---|
170 | <coverage> = bool indicating if data should not be interpolated (true means |
---|
171 | no interpolation) |
---|
172 | <token> = login credential |
---|
173 | map layer add <layerName> image gdal <url> <?cache?> <?coverage?> |
---|
174 | Add a GDAL image layer from a file or URL |
---|
175 | <url> = URL of source |
---|
176 | <cache> = bool indicating if tiles should be cached on disk |
---|
177 | <coverage> = bool indicating if data should not be interpolated (true means |
---|
178 | no interpolation) |
---|
179 | map layer add <layerName> image wms <url> <cache> <coverage> <layers> <format> <transparent> |
---|
180 | Add a WMS image layer from a URL + layer string |
---|
181 | <url> = URL of WMS service |
---|
182 | <cache> = bool indicating if tiles may be cached on disk |
---|
183 | <coverage> = bool indicating if data should not be interpolated (true means |
---|
184 | no interpolation) |
---|
185 | <layers> = layers string for WMS server |
---|
186 | <format> = Image format to return (e.g. 'png') |
---|
187 | <transparent> = bool |
---|
188 | map layer add <layerName> image tms <url> <cache> <coverage> |
---|
189 | Add a TMS image layer from a URL |
---|
190 | <url> = URL of TMS service |
---|
191 | <cache> = bool indicating if tiles should be cached on disk |
---|
192 | <coverage> = bool indicating if data should not be interpolated (true means |
---|
193 | no interpolation) |
---|
194 | map layer add <layerName> image xyz <urlPattern> <cache> <coverage> |
---|
195 | Add an image layer from a web map using a template URL |
---|
196 | <urlPattern> = URL template of source. '{x}', '{y}', '{z}' will be replaced |
---|
197 | with tile row (x), column (y) and zoom level (z). A block of characters in |
---|
198 | square braces can be used to specify round-robin server numbers, e.g. |
---|
199 | 'host[012]' will exand to 'host0', host1', 'host2'. |
---|
200 | <cache> = bool indicating if tiles should be cached on disk |
---|
201 | <coverage> = bool indicating if data should not be interpolated (true means |
---|
202 | no interpolation) |
---|
203 | |
---|
204 | Elevation layers: |
---|
205 | map layer add <layerName> elevation <driver> <url> <?cache?> |
---|
206 | Add an elevation image layer from a file or URL |
---|
207 | <driver> = gdal|tms|wms |
---|
208 | |
---|
209 | Feature/model layers: |
---|
210 | In the following: |
---|
211 | <driver> = ogr|tfs|wfs |
---|
212 | <format> = json|gml (for tfs or wfs driver) |
---|
213 | <typeName> = layer name for wfs driver |
---|
214 | <clamping> = none|terrain|relative|absolute |
---|
215 | <clamptechnique> = drape|gpu|scene|map |
---|
216 | |
---|
217 | map layer add <layerName> icon <driver> <format> <typeName> <url> <cache> <icon> <scale> <heading> <declutter> <placement> <alignment> <?visibilityRangeMin?> <?visibilityRangeMax?> |
---|
218 | Add an icon feature layer from a file or URL |
---|
219 | <placement> = vertex|centroid|interval|random |
---|
220 | <alignment> = left_top|left_center|left_bottom|center_top|center_center|center_bottom|right_top|right_center|right_bottom |
---|
221 | map layer add <layerName> line <driver> <format> <typeName> <url> <cache> <r> <g> <b> <width> <?cap?> <?join?> <?stipplePattern?> <?stippleFactor?> <?clamping?> <?clamptechnique?> <?visibilityRangeMin?> <?visibilityRangeMax?> |
---|
222 | Add a line feature layer from a file or URL |
---|
223 | cap/join only used if width > 1 |
---|
224 | <cap> = flat|square|round |
---|
225 | <join> = mitre|round |
---|
226 | map layer add <layerName> point <driver> <format> <typeName> <url> <cache> <r> <g> <b> <size> <?clamping?> <?clamptechnique?> <?visibilityRangeMin?> <?visibilityRangeMax?> |
---|
227 | Add a point feature layer from a file or URL |
---|
228 | map layer add <layerName> polygon <driver> <format> <typeName> <url> <cache> <r> <g> <b> <?lineWidth?> <?strokeR?> <?strokeG?> <?strokeB?> <?clamping?> <?clamptechnique?> <?visibilityRangeMin?> <?visibilityRangeMax?> |
---|
229 | Add a polygon feature layer from a file or URL |
---|
230 | map layer add <layerName> text <driver> <format> <typeName> <url> <cache> <content> <priority> <fgR> <fgG> <fgB> <bgR> <bgG> <bgB> <haloWidth> <fontSize> <removeDupes> <declutter> <alignment> <xoffset> <yoffset> <?visibilityRangeMin?> <?visibilityRangeMax?> |
---|
231 | Add a text symbol layer from a file or URL |
---|
232 | <alignment> = left_top|left_center|left_bottom|center_top|center_center|center_bottom|right_top|right_center|right_bottom|left_baseline|center|baseline|right_baseline|left_bottom_baseline|center_bottom_baseline|right_bottom_baseline |
---|
233 | |
---|
234 | map layer delete <layerName> |
---|
235 | map layer opacity <opacity> <layerName> |
---|
236 | map layer move <pos> <layerName> |
---|
237 | map layer visible <bool> <layerName> |
---|
238 | |
---|
239 | map load data follows <nbytes> |
---|
240 | Send an .earth file over the wire |
---|
241 | map load file <path> |
---|
242 | Load an .earth file from a filesystem mounted on the server |
---|
243 | map load url <url> |
---|
244 | Load an .earth file from a network address |
---|
245 | |
---|
246 | map posdisp <bool> <?format?> <?precision?> |
---|
247 | Toggle coordinate/position display, set format and precision |
---|
248 | <format> = latlong_decimal_degrees|latlong_degrees_decimal_minutes| |
---|
249 | latlong_degrees_minutes_seconds|mgrs |
---|
250 | <precision> = integer number of digits to display |
---|
251 | |
---|
252 | map reset <type> <r> <g> <b> <?profile?> <?xmin?> <?ymin?> <?xmax?> <?ymax?> |
---|
253 | Clear the scene and rebuild a new map from scratch. When resetting the |
---|
254 | map to geocentric, a profile and extents should be omitted. When the map |
---|
255 | type is projected, the profile is required and extents are optional. |
---|
256 | <type> = geocentric|projected |
---|
257 | <r>,<g>,<b> - Background color red, green and blue components [0,1] |
---|
258 | <profile> = Well known profile string, e.g. 'global-geodetic', |
---|
259 | 'global-mercator'. If specifying bounds (i.e. not global), use 'geodetic' |
---|
260 | or 'spherical-mercator' or an SRS init string (such as an EPSG code) |
---|
261 | xmin,ymin,xmax,ymax = map bounds (in profile projection/units) |
---|
262 | |
---|
263 | map scalebar <bool> <?units?> |
---|
264 | Toggle scale label/bar |
---|
265 | <units> = meters|feet|us_survey_feet|nautical_miles |
---|
266 | map setpos <x> <y> |
---|
267 | Set the coordinate/position display based on mouse coordinates |
---|
268 | map terrain edges <bool> |
---|
269 | *Not currently implemented* |
---|
270 | map terrain lighting <bool> |
---|
271 | map terrain linecolor <r> <g> <b> |
---|
272 | *Not currently implemented* |
---|
273 | map terrain vertscale <val> |
---|
274 | Set scale factor for terrain height |
---|
275 | map terrain wireframe <bool> |
---|
276 | map time <?hours?> <?day?> <?month?> <?year?> |
---|
277 | Set ephemeris time for sky. When args are omitted, set to current time. |
---|
278 | Time is interpreted as UTC. |
---|
279 | |
---|
280 | ================================================================================ |
---|
281 | Replies: |
---|
282 | ================================================================================ |
---|
283 | nv>image -type image -bytes <nbytes> |
---|
284 | <binary RGB data> |
---|
285 | nv>legend <colormapName> <rmin> <rmax> <nbytes> |
---|
286 | <binary RGB data> |
---|
287 | nv>map coords <token> <mapCoordList> <?srs?> <?verticalDatum?> |
---|
288 | Reply to query of map coordinates from screen coordinates. The mapCoordList |
---|
289 | is a list of x,y,z map coordinates. The srs of the map coordinates may be |
---|
290 | included if not in map's native coordinate system. NaN in the results |
---|
291 | indicates off-map input coordinates. |
---|
292 | nv>screen coords <token> <screenCoordList> |
---|
293 | Reply to query of screen coordinates from map coordinates. The |
---|
294 | screenCoordList is a list of x,y,z screen coordinates (z is the depth). NaN |
---|
295 | in the results indicates a point outside the view frustum or invalid input |
---|
296 | map coordinate |
---|
297 | nv>ok -token <seqnum> |
---|
298 | Reply indicated commands through <seqnum> (numbered beginning at 0) have been |
---|
299 | processed, but no new image was rendered |
---|
300 | ================================================================================ |
---|
301 | Error Replies: |
---|
302 | ================================================================================ |
---|
303 | nv>viserror -bytes <nbytes> |
---|
304 | <multi-line error string of nbytes> |
---|
305 | ================================================================================ |
---|