Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

dmorissette opened this issue May 8, 2013 · 5 comments
Assignees
Milestone

Comments

@dmorissette
Copy link
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.

@ghost ghost assigned aboudreault May 8, 2013
@aboudreault
Copy link
Member

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

@jmckenna
Copy link
Member

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

@jratike80
Copy link

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
Copy link
Contributor Author

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
Copy link
Member

Committed, doc updated.

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

No branches or pull requests

4 participants