Index: /geovis/trunk/Makefile.in
===================================================================
--- /geovis/trunk/Makefile.in	(revision 4628)
+++ /geovis/trunk/Makefile.in	(revision 4629)
@@ -9,4 +9,5 @@
 USE_THROTTLING_SLEEP    = #yes
 SLEEP_AFTER_QUEUE_FRAME = yes
+QUEUE_ONLY_ONE_FRAME    = yes
 
 bindir          = @bindir@
@@ -111,4 +112,7 @@
 DEFINES         += -DSLEEP_AFTER_QUEUE_FRAME
 endif
+ifdef QUEUE_ONLY_ONE_FRAME
+DEFINES         += -DQUEUE_ONLY_ONE_FRAME
+endif
 
 CXX_SWITCHES	= $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(DEFINES) $(INCLUDES)
Index: /geovis/trunk/RenderServer.h
===================================================================
--- /geovis/trunk/RenderServer.h	(revision 4628)
+++ /geovis/trunk/RenderServer.h	(revision 4629)
@@ -21,5 +21,5 @@
 class Stats;
 
-#define GEOVIS_VERSION_STRING "0.4"
+#define GEOVIS_VERSION_STRING "0.5.0"
 
 #define MSECS_ELAPSED(t1, t2) \
Index: /geovis/trunk/Renderer.cpp
===================================================================
--- /geovis/trunk/Renderer.cpp	(revision 4628)
+++ /geovis/trunk/Renderer.cpp	(revision 4629)
@@ -87,8 +87,8 @@
     _bgColor[2] = 0;
     //setMaximumFrameRateInHertz(15.0);
-    // 100MBit
+    // 100Mbit
     setMaximumBitrate(1.0e8);
     _lastFrameTime = _minFrameTime;
-    TRACE("Bandwidth target: %.2f MBit", (float)(getMaximumBitrate()/1.0e6));
+    TRACE("Bandwidth target: %.2f Mbps", (float)(getMaximumBitrate()/1.0e6));
     TRACE("Frame rate target: %.2f Hz", (float)getMaximumFrameRateInHertz());
 
@@ -1041,4 +1041,7 @@
     }
     osgEarth::ImageLayerOptions layerOpts(name, opts);
+#ifdef USE_OSGEARTH_TRUNK
+    layerOpts.textureCompression() = osg::Texture::USE_IMAGE_DATA_FORMAT;
+#endif
     if (makeShared) {
         layerOpts.shared() = true;
@@ -1321,5 +1324,5 @@
 
     setMaximumBitrate(origBitrate);
-    TRACE("Bandwidth target: %.2f MBit", (float)(getMaximumBitrate()/1.0e6));
+    TRACE("Bandwidth target: %.2f Mbps", (float)(getMaximumBitrate()/1.0e6));
     TRACE("Frame rate target: %.2f Hz", (float)getMaximumFrameRateInHertz());
 
Index: /geovis/trunk/Renderer.h
===================================================================
--- /geovis/trunk/Renderer.h	(revision 4628)
+++ /geovis/trunk/Renderer.h	(revision 4629)
@@ -20,4 +20,5 @@
 #include <osgViewer/Viewer>
 #include <osgGA/StateSetManipulator>
+#include <osgUtil/IncrementalCompileOperation>
 
 #include <osgEarth/StringUtils>
@@ -365,4 +366,12 @@
             rate = 0.25;
         _minFrameTime = 1.0/rate;
+        if (_viewer.valid()) {
+            osgUtil::IncrementalCompileOperation *op =
+                _viewer->getDatabasePager()->getIncrementalCompileOperation();
+            if (op != NULL) {
+                TRACE("Setting DB Pager target frame rate to %g", rate);
+                op->setTargetFrameRate(rate);
+            }
+        }
     }
 
Index: /geovis/trunk/RendererCmd.cpp
===================================================================
--- /geovis/trunk/RendererCmd.cpp	(revision 4628)
+++ /geovis/trunk/RendererCmd.cpp	(revision 4629)
@@ -107,5 +107,5 @@
     std::string cmd(str);
     cmd.erase(cmd.find_last_not_of(" \n\r\t")+1);
-    TRACE("command %lu: '%s'", g_stats.nCommands+1, cmd.c_str());
+    TRACE("command %lu: '%s'", g_stats.nCommands, cmd.c_str());
 #endif
     lastCmdStatus = TCL_OK;
@@ -772,6 +772,6 @@
 {
     int x, y;
-    if (Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK ||
-        Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK) {
+    if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK ||
+        Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) {
         return TCL_ERROR;
     }
@@ -779,12 +779,12 @@
     osgEarth::GeoPoint mapPoint;
     size_t length;
-    char mesg[256];
+    char mesg[512];
     if (g_renderer->mapMouseCoords(x, y, mapPoint)) {
         std::string srsInit;
         std::string verticalDatum;
-        if (objc > 4) {
-            srsInit = Tcl_GetString(objv[4]);
-            if (objc > 5) {
-                verticalDatum = Tcl_GetString(objv[5]);
+        if (objc > 5) {
+            srsInit = Tcl_GetString(objv[5]);
+            if (objc > 6) {
+                verticalDatum = Tcl_GetString(objv[6]);
             }
             osgEarth::SpatialReference *outSRS =
@@ -802,5 +802,6 @@
         // send coords to client
         length = snprintf(mesg, sizeof(mesg),
-                          "nv>map coords %g %g %g %d %d {%s} {%s}\n",
+                          "nv>map coords %s %g %g %g %d %d {%s} {%s}\n",
+                          Tcl_GetString(objv[2]), //g_stats.nCommands,
                           mapPoint.x(), mapPoint.y(), mapPoint.z(),
                           x, y,
@@ -812,5 +813,7 @@
         // Out of range
         length = snprintf(mesg, sizeof(mesg),
-                          "nv>map coords invalid %d %d\n", x, y);
+                          "nv>map coords %s invalid %d %d\n",
+                          Tcl_GetString(objv[2]), //g_stats.nCommands,
+                          x, y);
 
         queueResponse(mesg, length, Response::VOLATILE);
@@ -1547,5 +1550,5 @@
 
 static CmdSpec mapOps[] = {
-    {"coords",   1, MapCoordsOp,          4, 6, "x y ?srs? ?verticalDatum?"},
+    {"coords",   1, MapCoordsOp,          5, 7, "token x y ?srs? ?verticalDatum?"},
     {"grid",     1, MapGraticuleOp,       3, 4, "bool ?type?"},
     {"layer",    2, MapLayerOp,           3, 0, "op ?params...?"},
@@ -1750,11 +1753,11 @@
 {
     double x, y, z;
-    if (Tcl_GetDoubleFromObj(interp, objv[2], &x) != TCL_OK ||
-        Tcl_GetDoubleFromObj(interp, objv[3], &y) != TCL_OK ||
-        Tcl_GetDoubleFromObj(interp, objv[4], &z) != TCL_OK) {
+    if (Tcl_GetDoubleFromObj(interp, objv[3], &x) != TCL_OK ||
+        Tcl_GetDoubleFromObj(interp, objv[4], &y) != TCL_OK ||
+        Tcl_GetDoubleFromObj(interp, objv[5], &z) != TCL_OK) {
         return TCL_ERROR;
     }
     const osgEarth::SpatialReference *srs = NULL;
-    if (objc < 6) {
+    if (objc < 7) {
         srs = g_renderer->getMapSRS();
         if (srs == NULL) {
@@ -1763,8 +1766,8 @@
         }
     } else {
-        std::string srsInit(Tcl_GetString(objv[5]));
+        std::string srsInit(Tcl_GetString(objv[6]));
         std::string verticalDatum;
-        if (objc > 6) {
-            verticalDatum = Tcl_GetString(objv[6]);
+        if (objc > 7) {
+            verticalDatum = Tcl_GetString(objv[7]);
         }
         srs = osgEarth::SpatialReference::get(srsInit, verticalDatum);
@@ -1785,5 +1788,6 @@
         // send coords to client
         length = snprintf(mesg, sizeof(mesg),
-                          "nv>screen coords %g %g %g %g %g %g\n",
+                          "nv>screen coords %s %g %g %g %g %g %g\n",
+                          Tcl_GetString(objv[2]),
                           screen.x(), screen.y(), screen.z(),
                           x, y, z);
@@ -1793,5 +1797,7 @@
         // Out of range
         length = snprintf(mesg, sizeof(mesg),
-                          "nv>screen coords invalid %g %g %g\n", x, y, z);
+                          "nv>screen coords %s invalid %g %g %g\n",
+                          Tcl_GetString(objv[2]),
+                          x, y, z);
 
         queueResponse(mesg, length, Response::VOLATILE);
@@ -1817,5 +1823,5 @@
 static CmdSpec screenOps[] = {
     {"bgcolor", 1, ScreenBgColorOp, 5, 5, "r g b"},
-    {"coords",  1, ScreenCoordsOp, 5, 7, "x y z ?srs? ?verticalDatum?"},
+    {"coords",  1, ScreenCoordsOp, 6, 8, "token x y z ?srs? ?verticalDatum?"},
     {"size",    1, ScreenSizeOp, 4, 4, "width height"}
 };
Index: /geovis/trunk/ResponseQueue.cpp
===================================================================
--- /geovis/trunk/ResponseQueue.cpp	(revision 4628)
+++ /geovis/trunk/ResponseQueue.cpp	(revision 4629)
@@ -26,5 +26,5 @@
 }
 
-ResponseQueue::~ResponseQueue() 
+ResponseQueue::~ResponseQueue()
 {
     TRACE("Deleting ResponseQueue");
@@ -45,11 +45,12 @@
     if (pthread_mutex_lock(&_idle) != 0) {
         ERROR("can't lock mutex: %s", strerror(errno));
-    }	
+    }
+#ifdef QUEUE_ONLY_ONE_FRAME
     /* Examine the list and remove any queued responses of the same type. */
     TRACE("Before # of elements is %d", _list.size());
     for (std::list<Response *>::iterator itr = _list.begin();
          itr != _list.end();) {
-        /* Remove any duplicate image or legend responses. There should be no 
-         * more than one.  Note that if the client starts using multiple legends 
+        /* Remove any duplicate image or legend responses. There should be no
+         * more than one.  Note that if the client starts using multiple legends
          * for different fields, this optimization should be disabled for legends.
          * We may also need to differentiate between screen images and "hardcopy"
@@ -67,4 +68,5 @@
         }
     }
+#endif
     /* Add the new response to the end of the list. */
     _list.push_back(response);
@@ -75,5 +77,5 @@
     if (pthread_mutex_unlock(&_idle) != 0) {
         ERROR("can't unlock mutex: %s", strerror(errno));
-    }	
+    }
 }
 
@@ -105,5 +107,5 @@
     if (pthread_mutex_unlock(&_idle) != 0) {
         ERROR("can't unlock mutex: %s", strerror(errno));
-    }	
+    }
     return response;
 }
Index: /geovis/trunk/geovis_protocol.txt
===================================================================
--- /geovis/trunk/geovis_protocol.txt	(revision 4628)
+++ /geovis/trunk/geovis_protocol.txt	(revision 4629)
@@ -90,6 +90,7 @@
 
 screen bgcolor <r> <g> <b>
-screen coords <x> <y> <z> <?srs?> <?verticalDatum?>
+screen coords <token> <x> <y> <z> <?srs?> <?verticalDatum?>
        Transate map coordinates to screen/mouse coordinates.
+       <token> - String token, included in response
        <x>,<y>,<z> - Map coordinates.  If srs not given, these are in the map's 
        coordinate system.
@@ -114,6 +115,7 @@
 == Map Commands ==
 
-map coords <x> <y> <?srs?> <?verticalDatum?>
+map coords <token> <x> <y> <?srs?> <?verticalDatum?>
     Translate screen/mouse coordinates into map coordinates.
+    <token> - String token, included in response
     <x>,<y> - Screen/mouse coordinates
     <srs> - Optional horizontal srs init string for coordinate system to return
@@ -207,15 +209,15 @@
 nv>image -type image -bytes <nbytes>
   <binary RGB data>
-nv>map coords <mapX> <mapY> <mapZ> <screenX> <screenY> <?srs?> <?verticalDatum?>
+nv>map coords <token> <mapX> <mapY> <mapZ> <screenX> <screenY> <?srs?> <?verticalDatum?>
    Reply to query of map coordinates from screen coordinates.  srs of the map
    coordinates may be included if not in map's native coordinate system
-nv>map coords invalid <mouseX> <mouseY>
+nv>map coords <token> invalid <mouseX> <mouseY>
    Reply indicating an off-map click/query
-nv>screen coords <screenX> <screenY> <screenZ> <mapX> <mapY> <mapZ>
+nv>screen coords <token> <screenX> <screenY> <screenZ> <mapX> <mapY> <mapZ>
    Reply to query of screen coordinates from map coordinates
-nv>screen coords invalid <mapX> <mapY> <mapZ>
+nv>screen coords <token> invalid <mapX> <mapY> <mapZ>
    Reply indicating requested point is out of the view frustum
 nv>ok -token <seqnum>
-   Reply indicated commands through <seqnum> (numbered beginning at 1) have been
+   Reply indicated commands through <seqnum> (numbered beginning at 0) have been
    processed, but no new image was rendered
 ================================================================================
