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 get |
---|
36 | Request camera parameters |
---|
37 | camera 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 |
---|
42 | camera orient <quatW> <quatX> <quatY> <quatZ> |
---|
43 | Set scene orientation using a quaternion |
---|
44 | camera 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 |
---|
49 | camera reset <?all?> |
---|
50 | Option all resets orientation/rotation as well as pan/zoom/clip range |
---|
51 | camera restore <name> <?duration?> |
---|
52 | Set viewpoint to a named viewpoint, with optional animation duration in |
---|
53 | seconds |
---|
54 | camera rotate <x> <y> |
---|
55 | Specify relative rotation in viewport coordinates |
---|
56 | camera save <name> |
---|
57 | Save current viewpoint to a named viewpoint |
---|
58 | camera 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 |
---|
68 | camera throw <bool> |
---|
69 | Enable/disable throw inertia for panning/rotating when using mouse events |
---|
70 | through protocol |
---|
71 | camera zoom <y> |
---|
72 | Specify zoom by viewport coordinates (i.e. normalized y mouse coords) |
---|
73 | |
---|
74 | clientinfo <list> |
---|
75 | |
---|
76 | colormap 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 |
---|
80 | colormap define <colorMapName> <colorMap> |
---|
81 | (Re-)define a colormap (same as 'add') |
---|
82 | colormap delete <?colorMapName?> |
---|
83 | colormap res <numberOfTableEntries> |
---|
84 | Set the "resolution" or number of lookup table entries in the colormap |
---|
85 | <numberOfTableEntries> = integer or "default" |
---|
86 | |
---|
87 | renderer render |
---|
88 | Force a new image to be rendered |
---|
89 | |
---|
90 | screen bgcolor <r> <g> <b> |
---|
91 | screen 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 |
---|
100 | screen size <width> <height> |
---|
101 | |
---|
102 | == Mouse and Keyboard Events == |
---|
103 | |
---|
104 | key press <key> |
---|
105 | key release <key> |
---|
106 | |
---|
107 | mouse click <button> <x> <y> |
---|
108 | mouse dblclick <button> <x> <y> |
---|
109 | mouse drag <button> <x> <y> |
---|
110 | mouse motion <x> <y> |
---|
111 | mouse release <button> <x> <y> |
---|
112 | mouse scroll <direction> |
---|
113 | |
---|
114 | == Map Commands == |
---|
115 | |
---|
116 | map attrib <string> |
---|
117 | <string> - Attribution/copyright to display in corner of map |
---|
118 | |
---|
119 | map 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 |
---|
126 | |
---|
127 | map grid <bool> <?type?> |
---|
128 | Toggle graticule and set type |
---|
129 | <type> = geodetic|utm|mgrs |
---|
130 | |
---|
131 | General form: |
---|
132 | map layer add <layerName> <type> <driver> <url> ... |
---|
133 | <type> = image|elevation|line|point|polygon|text |
---|
134 | <driver> = colorramp|debug|gdal|tms|wms|xyz |
---|
135 | |
---|
136 | Specific image layer types: |
---|
137 | map layer add <layerName> image colorramp <url> <cache> <elevdriver> <profile> <colormapName> |
---|
138 | Add a colormapped image layer from a file or URL |
---|
139 | <url> = URL of source |
---|
140 | <cache> = bool indicating if tiles should be cached on disk |
---|
141 | <elevdriver> = Elevation driver to read source |
---|
142 | <profile> = profile of source |
---|
143 | <colormapName> = Name of colormap |
---|
144 | map layer add <layerName> image gdal <url> <cache> |
---|
145 | Add a GDAL image layer from a file or URL |
---|
146 | map layer add <layerName> image wms <url> <cache> <layers> <format> <transparent> |
---|
147 | Add a WMS image layer from a URL + layer string |
---|
148 | <url> = URL of WMS service |
---|
149 | <cache> = bool indicating if tiles should be cached on disk |
---|
150 | <layers> = layers string for WMS server |
---|
151 | <format> = Image format to return (e.g. 'png') |
---|
152 | <transparent> = bool |
---|
153 | map layer add <layerName> image tms <url> <cache> |
---|
154 | Add a TMS image layer from a URL |
---|
155 | <url> = URL of TMS service |
---|
156 | <cache> = bool indicating if tiles should be cached on disk |
---|
157 | map layer add <layerName> image xyz <urlPattern> <cache> |
---|
158 | Add an image layer from a web map using a template URL |
---|
159 | <cache> = bool indicating if tiles should be cached on disk |
---|
160 | |
---|
161 | Elevation layers: |
---|
162 | map layer add <layerName> elevation <driver> <url> |
---|
163 | Add an elevation image layer from a file or URL |
---|
164 | <driver> = gdal|tms|wms |
---|
165 | |
---|
166 | Feature/model layers: |
---|
167 | map layer add <layerName> point <url> <r> <g> <b> <size> |
---|
168 | Add a point feature layer from a file or URL |
---|
169 | map layer add <layerName> polygon <url> <r> <g> <b> <width> |
---|
170 | Add a polygon feature layer from a file or URL |
---|
171 | map layer add <layerName> line <url> <r> <g> <b> <width> |
---|
172 | Add a line feature layer from a file or URL |
---|
173 | map layer add <layerName> text <url> <content> <priority> <fgR> <fgG> <fgB> <bgR> <bgG> <bgB> <haloWidth> <fontSize> <removeDupes> <declutter> <visibilityRangeMin> <visibilityRangeMax> |
---|
174 | Add a text symbol layer from a file or URL |
---|
175 | |
---|
176 | map layer delete <layerName> |
---|
177 | map layer opacity <opacity> <layerName> |
---|
178 | map layer move <pos> <layerName> |
---|
179 | map layer visible <bool> <layerName> |
---|
180 | |
---|
181 | map load data follows <nbytes> |
---|
182 | Send an .earth file over the wire |
---|
183 | map load file <path> |
---|
184 | Load an .earth file from a filesystem mounted on the server |
---|
185 | map load url <url> |
---|
186 | Load an .earth file from a network address |
---|
187 | |
---|
188 | map posdisp <bool> <?format?> <?precision?> |
---|
189 | Toggle coordinate/position display, set format and precision |
---|
190 | <format> = latlong_decimal_degrees|latlong_degrees_decimal_minutes| |
---|
191 | latlong_degrees_minutes_seconds|mgrs |
---|
192 | <precision> = integer number of digits to display |
---|
193 | |
---|
194 | map reset <type> <r> <g> <b> <?profile?> <?xmin?> <?ymin?> <?xmax?> <?ymax?> |
---|
195 | Clear the scene and rebuild a new map from scratch. When resetting the |
---|
196 | map to geocentric, a profile and extents should be omitted. When the map |
---|
197 | type is projected, the profile is required and extents are optional. |
---|
198 | <type> = geocentric|projected |
---|
199 | <r>,<g>,<b> - Background color red, green and blue components [0,1] |
---|
200 | <profile> = Well known profile string, e.g. 'global-geodetic', |
---|
201 | 'global-mercator'. If specifying bounds (i.e. not global), use 'geodetic' |
---|
202 | or 'spherical-mercator' or an SRS init string (such as an EPSG code) |
---|
203 | xmin,ymin,xmax,ymax = map bounds (in profile projection/units) |
---|
204 | |
---|
205 | map scalebar <bool> <?units?> |
---|
206 | Toggle scale label/bar |
---|
207 | <units> = meters|feet|us_survey_feet|nautical_miles |
---|
208 | map setpos <x> <y> |
---|
209 | Set the coordinate/position display based on mouse coordinates |
---|
210 | map terrain edges <bool> |
---|
211 | *Not currently implemented* |
---|
212 | map terrain lighting <bool> |
---|
213 | map terrain linecolor <r> <g> <b> |
---|
214 | *Not currently implemented* |
---|
215 | map terrain vertscale <val> |
---|
216 | Set scale factor for terrain height |
---|
217 | map terrain wireframe <bool> |
---|
218 | map time <?hours?> <?day?> <?month?> <?year?> |
---|
219 | Set ephemeris time for sky. When args are omitted, set to current time. |
---|
220 | Time is interpreted as UTC. |
---|
221 | |
---|
222 | ================================================================================ |
---|
223 | Replies: |
---|
224 | ================================================================================ |
---|
225 | nv>image -type image -bytes <nbytes> |
---|
226 | <binary RGB data> |
---|
227 | nv>legend <colormapName> <rmin> <rmax> <nbytes> |
---|
228 | <binary RGB data> |
---|
229 | nv>map coords <token> <mapCoordList> <?srs?> <?verticalDatum?> |
---|
230 | Reply to query of map coordinates from screen coordinates. The mapCoordList |
---|
231 | is a list of x,y,z map coordinates. The srs of the map coordinates may be |
---|
232 | included if not in map's native coordinate system. NaN in the results |
---|
233 | indicates off-map input coordinates. |
---|
234 | nv>screen coords <token> <screenCoordList> |
---|
235 | Reply to query of screen coordinates from map coordinates. The |
---|
236 | screenCoordList is a list of x,y,z screen coordinates (z is the depth). NaN |
---|
237 | in the results indicates a point outside the view frustum or invalid input |
---|
238 | map coordinate |
---|
239 | nv>ok -token <seqnum> |
---|
240 | Reply indicated commands through <seqnum> (numbered beginning at 0) have been |
---|
241 | processed, but no new image was rendered |
---|
242 | ================================================================================ |
---|
243 | Error Replies: |
---|
244 | ================================================================================ |
---|
245 | nv>viserror -bytes <nbytes> |
---|
246 | <multi-line error string of nbytes> |
---|
247 | ================================================================================ |
---|