Add an option to treat WMS BBOX in PixelIsPoint mode #4652

Closed
dmorissette opened this Issue May 8, 2013 · 5 comments

Projects

None yet

4 participants

@dmorissette
Contributor

The need:

Add a "wms_bbox_mode" metadata that can be set to "PixelIsPoint" in a given mapfile to tell MapServer to treat the BBOX received in WMS GetMap requests as if it was provided in PixelIsPoint mode. Essentially disabling the conversion from PixelIsArea (WMS model) to PixelIsPoint (MapServer internal model) that is present in mapwms.c for that specific mapfile.

This option is required to accommodate WorldWind clients which (incorrectly) send requests with a BBOX in PixelIsPoint model. Until the client code is fixed, this option would be required to allow MapServer to serve imagery and elevation data to WorldWind clients.

The option would have no side-effect for general users who do not use it.

Background:

The WMS specification states that the BBOX in a GetMap URL corresponds to the georeferenced coordinates of the outside boundary of the corner pixels of the requested image... essentially saying that WMS uses the PixelIsArea model to reuse the terminology used in some GIS libs.

As you all know, MapServer uses the PixelIsPoint model internally, that is: the map->extents coordinates correspond to the georeferenced coordinates of the center of the corner pixels of the requested image.

When WMS was introduced several years ago, we had to introduce WMS-specific code to convert the GetMap BBOX from the WMS PixelIsArea model to MapServer's internal PixelIsPoint model... you can see this code here:

https://github.com/mapserver/mapserver/blob/8b75bd04c04c63c440d90756ecf2520dd887faf9/mapwms.c#L1678-L1694

Setting metadata "wms_bbox_mode" to "PixelIsPoint" in a mapfile would disable this block of code and produce the result that WorldWind clients expect, even if it's not strictly WMS compliant.

@aboudreault aboudreault was assigned May 8, 2013
@aboudreault
Member

Thanks Daniel for the issue. I'll work on this as soon as possible.

@jmckenna
Member

adding myself as participant to this ticket (can test).

@jratike80

Have you considered to call it "EnablePixelIsPoint" and make Mapserver to require also a GetMap vendor parameter like &pixel_is_point=TRUE before this half a pixel adjustment happens? That way both WorldWind and standard WMS clients could be happy with the same service.

@dmorissette
Contributor

Good question. Initially that was not possible (I save you the details) but the new WorldWind setup uses a wrapper in which we could add such a param to the URL, making what you suggest possible.

To make things even more straightforward, how about we simply add a vendor-specific parameter called "bbox_pixel_is_point=TRUE" in the GetMap URL? There is no need for any setting in the mapfile to enable this since the absence of the vendor-specific bbox_pixel_is_point=TRUE in the URL is enough to disable this behavior for normal clients.

@aboudreault aboudreault pushed a commit that referenced this issue Jun 21, 2013
Alan Boudreault Added bbox_pixel_is_point parameter for WMS GetMap (#4652) f99df0b
@aboudreault
Member

Committed, doc updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment