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 dataset, 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 seconds |
---|
53 | camera rotate <x> <y> |
---|
54 | Specify relative rotation in viewport coordinates |
---|
55 | camera save <name> |
---|
56 | Save current viewpoint to a named viewpoint |
---|
57 | camera set <x> <y> <z> <heading> <pitch> <distance> <?duration?> <?srs?> <?vertDatum?> |
---|
58 | Explicitly set camera parameters, with optional animation duration in seconds |
---|
59 | <x>, <y> = Map coordinates of focal point |
---|
60 | <z> = Altitude of focal point (see vertDatum) |
---|
61 | <heading> = Azimuth in degrees |
---|
62 | <pitch> = Elevation in degrees |
---|
63 | <distance> = Distance of camera from focal point in map units(?) |
---|
64 | <srs> = coordinate system, defaults to map coordinate system |
---|
65 | <vertDatum> = vertical datum for interpreting z coordinate |
---|
66 | camera zoom <y> |
---|
67 | Specify zoom by viewport coordinates (i.e. normalized y mouse coords) |
---|
68 | |
---|
69 | clientinfo <list> |
---|
70 | |
---|
71 | key press <key> |
---|
72 | key release <key> |
---|
73 | |
---|
74 | mouse click <button> <x> <y> |
---|
75 | mouse dblclick <button> <x> <y> |
---|
76 | mouse drag <button> <x> <y> |
---|
77 | mouse motion <x> <y> |
---|
78 | mouse release <button> <x> <y> |
---|
79 | mouse scroll <direction> |
---|
80 | |
---|
81 | renderer render |
---|
82 | Force a new image to be rendered |
---|
83 | |
---|
84 | screen bgcolor <r> <g> <b> |
---|
85 | screen size <width> <height> |
---|
86 | |
---|
87 | map coords <x> <y> |
---|
88 | Translate screen/mouse coordinates into map coordinates |
---|
89 | |
---|
90 | General form: |
---|
91 | map layer add <type> <driver> <url> ... <layerName> |
---|
92 | <type> = image|elevation|line|point|polygon|text |
---|
93 | <driver> = gdal|wms|tms |
---|
94 | |
---|
95 | Specific layer types: |
---|
96 | map layer add image gdal <url> <layerName> |
---|
97 | Add a GDAL image layer from a file or URL |
---|
98 | map layer add image wms <url> <layers> <format> <transparent> <layerName> |
---|
99 | Add a WMS image layer from a URL + layer string |
---|
100 | <url> = URL of WMS service |
---|
101 | <layers> = layers string for WMS server |
---|
102 | <format> = Image format to return (e.g. 'png') |
---|
103 | <transparent> = bool |
---|
104 | map layer add image tms <url> <layerName> |
---|
105 | Add a TMS image layer from a URL |
---|
106 | <url> = URL of TMS service |
---|
107 | map layer add elevation <driver> <url> <layerName> |
---|
108 | Add an elevation image layer from a file or URL |
---|
109 | <driver> = gdal|tms|wms |
---|
110 | map layer add point <url> <layerName> |
---|
111 | Add a point feature layer from a file or URL |
---|
112 | map layer add polygon <url> <layerName> |
---|
113 | Add a polygon feature layer from a file or URL |
---|
114 | map layer add line <url> <layerName> |
---|
115 | Add a line feature layer from a file or URL |
---|
116 | map layer add text <url> <layerName> |
---|
117 | Add a text symbol layer from a file or URL |
---|
118 | |
---|
119 | map layer delete <layerName> |
---|
120 | map layer opacity <opacity> <layerName> |
---|
121 | map layer move <pos> <layerName> |
---|
122 | map layer visible <bool> <layerName> |
---|
123 | map load data follows <nbytes> |
---|
124 | Send an .earth file over the wire |
---|
125 | map load file <path> |
---|
126 | Load an .earth file from a filesystem mounted on the server |
---|
127 | map load url <url> |
---|
128 | Load an .earth file from a network address |
---|
129 | map reset <type> <?profile?> <?xmin?> <?ymin?> <?xmax?> <?ymax?> |
---|
130 | Clear the scene and rebuild a new map from scratch. When resetting the |
---|
131 | map to geocentric, a profile and extents should be omitted. When the map |
---|
132 | type is projected, the profile is required and extents are optional. |
---|
133 | type = geocentric|projected |
---|
134 | profile = Well known profile string, e.g. 'global-geodetic', |
---|
135 | 'global-mercator'. If specifying bounds (i.e. not global), use 'geodetic' |
---|
136 | or 'spherical-mercator' or an SRS init string (such as an EPSG code) |
---|
137 | xmin,ymin,xmax,ymax = map bounds (in profile projection/units) |
---|
138 | |
---|
139 | ================================================================================ |
---|
140 | Replies: |
---|
141 | ================================================================================ |
---|
142 | nv>image -type image -bytes <nbytes> |
---|
143 | <binary RGB data> |
---|
144 | nv>dataset coords <x> <y> <z> |
---|
145 | nv>ok -token <seqnum> |
---|
146 | Reply indicated commands through <seqnum> (numbered beginning at 1) have been |
---|
147 | processed, but no new image was rendered |
---|
148 | ================================================================================ |
---|
149 | Error Replies: |
---|
150 | ================================================================================ |
---|
151 | nv>viserror -bytes <nbytes> |
---|
152 | <multi-line error string of nbytes> |
---|
153 | ================================================================================ |
---|