[OSGeo-Standards] Handling of resolution (or scale?) in WMSC

Christopher Schmidt crschmidt at metacarta.com
Thu Sep 4 10:01:08 EDT 2008


On Wed, Sep 03, 2008 at 09:40:38PM -0700, Jody Garnett wrote:
> Christopher Schmidt wrote:
> >"Scale" requires DPI assumption. "Resolution" does not.  
> >  
> You are correct; it seems that WMSC is reporting back the "resolution" 
> of tile pixels to data units. However ... uDig allows users to set the 
> scale of the current map (ie zoom in and zoom out). 

Sure, OpenLayers does this too. We have a built in, configurable
definition of what 'DPI' is in use.   

> As such we would like to calculate the scale to zoom to in order to
> see a WMSC layer at one pixel 2 one pixel.  

Given a tile, this is easy to calculate -- once you make an assumption
about display resolution. But that assumption is in your application
code, not in the WMS-C spec. 

If you have a 256 px tile, and you are scaling it, it is at 1x1 when you
are displaying it at 256px. How you figure out how big that is is up to
the application, right?

> For WMS we are aware of how to do this since the rules by which it
> produces a pixel are well known.

I don't think that's any less true for WMS-C. Just the association of
'scale' to 'pixel' are not defined (Because we choose not to define
them, since they require false assumptions about how the data is being
displayed.)

> I need to figure out something similar for WMSC.  I had a pretty good 
> chat with Arne Kepp on IRC and he shares your opionion that this is not 
> a reasonable request. But I am still left with the need - it looks like 
> my best bet is to calculate a bounds to zoom to (as that will be easier 
> than sorting out the scale...

I'm really not sure I understand this. If you know the units of your
map, and you know the resolution of your map, then it's trivial to make
an assumption about DPI and determine scale.

http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Util.js#L1012

Regards,
-- 
Christopher Schmidt
MetaCarta


More information about the Standards mailing list