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

Last change on this file since 4320 was 4320, checked in by ldelgass, 10 years ago

Add map coords command to convert screen/mouse x/y to map coords

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