[webmap-discuss] WMS Requests: Rounding BBOX

Christopher Schmidt crschmidt at metacarta.com
Thu Sep 21 16:20:38 EDT 2006


On Thu, Sep 21, 2006 at 11:27:31AM -0600, Tim Schaub wrote:
> I think some of this responsibility (for determining precision) should be
> assigned to the server.  By that, I mean that a server offering tiled WMS
> should have to advertise the resolution of it's tiles (in map units per
> pixel).  This resolution would then be used as the basis for determining the
> precision of client requests.
> 
> Say that everybody agrees that a pixel edge lines up with the origin of your
> (map) coordinate system.  (This doesn't mean that a client has to enforce
> that pixel[0,0] = map[0,0] - only that they agree that the coordinate
> system's origin lines up with a pixel edge.)  If there is agreement here,
> then all BBOX requests should be integer multiples of the advertised
> resolutions.  Specifically:
> 
> bbox_top = (res * round(top/res)).toFixed(precision)
> 
> where precision is the decimal precision of the advertised resolution and
> the rest is obvious.

Is it trivial to find out the precision of a number in various
languages? I don't know how to do it off the top of my head in
Javascript, but maybe I'm being a bit naive. 

> So if a server says it has tiles at a resolution of 0.333, then it means 333
> map units per 1000 pixels, and all requests should be integer multiples of
> 0.333 (rounded to the nearest thousandth).
> 
> I know this doesn't do anything for people who find meaning in things like
> zoom and ScaleHint.  However, given the chance to come up with a new
> standard, it would be nice to start with something a bit more logical.

I don't know what scaleHint is, but zoom is usually just a shorthand for
describing resolutions, and scale is just an inverse of resolution:
1:150M is around 1.2 degrees/pixel assuming 72 pixels/inch. We discussed
at the tiling meeting that scale is a relic, and should not be
considered as a canonical term when dealing with on-screen webmapping.
Using precision of resolution as advertised by a server seems to make
sense to me.

-- 
Christopher Schmidt
MetaCarta




More information about the Webmap-discuss mailing list