[GRASS-dev] Scale display in GRASS Monitor

Glynn Clements glynn at gclements.plus.com
Fri Sep 22 12:21:27 EDT 2006


Markus Neteler wrote:

> > The only reliable way for a client to obtain the display resolution is
> > to ask the driver for this information (querying the resolution of
> > some random X server which may or may not be the one on which XDRIVER
> > is running is no better than hardcoding 75x75dpi; or using rand(), for
> > that matter).
> 
> I don't know if this is really close to rand(). Scale display could be
> contitionalized to local connections.

You don't know whether the monitor is using a local connection. 
Actually, the monitor might not even know; if you use ssh's X
forwarding, the connection appears to be location (sshd creates a
local proxy, so the connection will appear local).

> > For the driver to provide this information, there needs to be an R_*
> > function (and a corresponding protocol opcode). In turn, this means
> > that each driver must implement this operation. It's easy enough to do
> > for XDRIVER (although I suspect that libW11 will need to be extended
> > or else --enable-w11 will stop working), but what should the PNG
> > driver implementation do?
> 
> Given all these problems, I wonder how
> - qgis
> - udig
> - ESRI
> - Mapserver
> - ...
> 
> are displaying the scale? All fooling the user?

Most likely. IOW, I suspect that the scale is based upon the
"reported" display resolution (e.g. 96dpi for Windows) rather than on
reality.

> GRASS is probably the only GIS in the world not displaying a scale
> (how does d.barscale work?).

d.barscale doesn't need to know anything about the resolution of the
display. It only needs to know the conversion between metres and
pixels, the same as every other map display module.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list