[webmap-discuss] WMS Requests: Rounding BBOX

Tim Schaub noreply at geocartic.com
Thu Sep 21 13:27:31 EDT 2006


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.

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.

This also somewhat limits people putting together a tiled WMS.  It means you
can't have a tile resolution of 0.333 and expect to serve a tile that starts
at (10.000, 10.000) or something.  However, I can't see how this is a real
problem.

Perhaps this doesn't advance the discussion at all, but I just wanted to add
my thoughts.  I guess I also agree with Paul that decimal precision should
be a property of the layer - so the person configuring the client
application checks the server to see what the appropriate precision for each
layer should be.

And now I see that the immediate issue is how to cater to servers that are
caching based on URL - so picking a default decimal precision (for layers)
makes sense.

Tim
   

> -----Original Message-----
> From: Paul Spencer [mailto:pspencer at dmsolutions.ca] 
> Sent: Thursday, September 21, 2006 8:29 AM
> To: webmap-discuss at mail.osgeo.org
> Subject: Re: [webmap-discuss] WMS Requests: Rounding BBOX
> 
> Chris, could the amount of rounding be configurable per layer 
> with a reasonable default of 6 ... so that if you know you 
> are working in a different projection where that doesn't make 
> sense, you can override it?
> 
> Paul
> 
> On 21-Sep-06, at 6:32 AM, Christopher Schmidt wrote:
> 
> > On Thu, Sep 21, 2006 at 12:20:01PM +0200, Steven M. Ottens wrote:
> >> Christopher Schmidt wrote:
> >>> Today, an OpenLayers user asked me why we weren't rounding BBOX 
> >>> values in our tiled image requests, since it was causing problems 
> >>> with his reverse proxy caching to have OpenLayers not do so. The 
> >>> primary reason this isn't done at the moment is that I 
> couldn't pick 
> >>> a good value to use :)
> >>>
> >>> 6 decimal places seems to be a generally good value to cut-off at 
> >>> when working in degrees: that gets you down to half-meter 
> accuracy 
> >>> (I think?). Does anyone have any other thoughts on this? How have 
> >>> you addressed rounding BBOX requests in your own applications?
> >> 6 decimal places for lat/long is fine. I don't think we need to be 
> >> able to give bounding boxes in mm on lat/long systems 
> anyway. But 6 
> >> decimal places for projected ones is a bit overkill. Can you make 
> >> sure that those bounding boxes are rounded in a more sensible way?
> >
> > What is sensible? I know that I can implement it in OpenLayers, but 
> > there needs to be some kind of agreement on what makes sense... the 
> > problem being that what makes sense for you or I doesn't make sense 
> > for everyone.
> >
> > For systems using meters, usually two decimal places is 
> overkill...  
> > but
> > there might be someone working with extremely large scale 
> cad drawings 
> > (1:10, or 1:100) where webmap clients make sense... and that 1 cm 
> > difference could be major.
> >
> > Should rounding be based on the current scale? I think 
> that's the only 
> > way to make sure that requests are never going to lose 
> precision which 
> > is neccesary for correctly displaying the map -- otherwise, 
> when you 
> > get into 1px = 1unit, you'll run into problems with most any 
> > rounding...
> >
> > Does anyone have use cases where rounding has played an effect?
> >
> > I know that when I was first working with ka-map, I 
> actually did see 
> > rounding have an effect. THe ka-Map tiling engine rounded scale 
> > requests to the nearest integer. Since ka-Map requires you to enter 
> > fixed scales, this had never been a problem: but when you try to 
> > combined OpenLayers and ka-map, it did become a problem -- rounding 
> > scale to the nearest integer caused errors that could be as high as 
> > half a tile as the tile got further and further from the geographic 
> > meridians. So, I'm aware that these things do matter... but 
> not sure 
> > at what point they matter.
> > Rounding the scale to four decimal places brought any such 
> differences 
> > to being invisible -- but is that enough for bounding boxes?
> >
> > --
> > Christopher Schmidt
> > MetaCarta
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: webmap-discuss-unsubscribe at mail.osgeo.org
> > For additional commands, e-mail: webmap-discuss-help at mail.osgeo.org
> >
> 
> +-----------------------------------------------------------------+
> |Paul Spencer                           pspencer at dmsolutions.ca   |
> +-----------------------------------------------------------------+
> |Chief Technology Officer                                         |
> |DM Solutions Group Inc                 http://www.dmsolutions.ca/|
> +-----------------------------------------------------------------+
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webmap-discuss-unsubscribe at mail.osgeo.org
> For additional commands, e-mail: webmap-discuss-help at mail.osgeo.org
> 
> 
> 





More information about the Webmap-discuss mailing list