Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3602 closed enhancement (fixed)

In getCapabilities, output <BoundingBox> for each projection in layer's wms_srs

Reported by: mraross Owned by: assefa
Priority: normal Milestone: 6.0 release
Component: WMS Server Version: unspecified
Severity: normal Keywords:
Cc: schpidi, havatv

Description

Currently, getCapabilities will output a <BoundingBox> element for the projection the layer data is defined in. If a layer contains the following definition:

PROJECTION

"init=EPSG:3005"

END #projection

getCapabilities will include the following layer metadata:

<BoundingBox SRS="EPSG:3005" minx="200000" miny="200000" maxx="1.9e+006" maxy="1.9e+006" />

If a layer also contains a wms_srs Metadata element:

wms_srs "EPSG:3785 EPSG:3857 EPSG:102190 EPSG:26907 EPSG:26707 EPSG:32607 EPSG:3005 EPSG:42102 EPSG:4269 EPSG:4326 EPSG:26708 EPSG:26709 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26908 EPSG:26909 EPSG:26910 EPSG:26911 EPSG:26912 EPSG:32608 EPSG:32609 EPSG:32610 EPSG:32611 EPSG:32612 EPSG:54004"

getCapabilities will not generate a BoundingBox element for each projection in the wms_srs list. This causes awkward projection behavior when adding wms layers to a map in some wms clients (e.g., GAIA, ArcMap)

Enhance MapServer so it generates a BoundingBox element for each projection in the wms_srs list.

Attachments (1)

bbox_chodgson.patch (8.1 KB ) - added by chodgson 13 years ago.
Revised patch.

Download all attachments as: .zip

Change History (10)

comment:1 by assefa, 13 years ago

This is something that can be an enhancement. Possibly the default behaviour can be kept but with an extra metada set (something like wms_bbox_extened or something), all bbox for all wms_srs can be added to the capabilities docuement.

comment:2 by mraross, 13 years ago

Sounds good to me.

comment:3 by chodgson, 13 years ago

The attached patch implements this functionality.

If the metadata flag "wms_bbox_extended" is set to "true" BBOXES for all projections listed in "wms_srs" will be included in the capabilities. If wms_srs is not set at the layer level, the map level metadata for wms_srs is used, and if that is not set, then the layer's native projection is used. If wms_bbox_extended is set in the map-level metadata, it applies to all layers, unless the layer specifically overrides it with wms_bbox_extended set to false in the layer-level metadata. It also applies to the bbox(es) output for map-level parent layer in the capabilities.

If the wms_bbox_extended flag is not set true for the layer or the map, or it is set false by the layer, the existing behavior is implemented, ie. a single bbox in the layer's native projection is written to the capabilities (in addition to the required latlon box).

It should be noted that the onus is on the creator of the map file to ensure that the wms_srs metadata is appropriate - ie. to maintain the hierarchy induced by the map/layer relationship. This is unchanged from before; however since the intent of this patch is to increase compatibility with various clients, it is important to note that this feature doesn't enforce any rules around the wms_srs values, it just allows bboxes to be output for everything listed therein.

Setting the parameters at the map-level metadata should be the easiest way to ensure maximal compatibility - and this also reduces redundancy in the mapfile.

by chodgson, 13 years ago

Attachment: bbox_chodgson.patch added

Revised patch.

comment:4 by assefa, 13 years ago

will do the commit before 6.0.

comment:5 by assefa, 13 years ago

committed in r10921. Closing.

comment:6 by assefa, 13 years ago

Resolution: fixed
Status: newclosed

comment:7 by Schpidi, 13 years ago

Corrected missing SRS attribute content in BoudingBox element in r11236.

Adjusted expected results in r11237.

comment:8 by chodgson, 13 years ago

Cc: schpidi added

Schpidi are you certain that change is correct? The comment 2 lines above seems to indicate that it is not. That code was not changed by my patch, it was in place as is before r10921. If you are certain it is correct, you should probably remove the comment above and/or replace it with something appropriate, as well as the related comment in the function header.

Actually I guess the reason that the comment was important is before the implementation of wms_bbox_extended, there was no code in place to do reprojection from the "native" bbox to the "wms_srs" bbox.

I guess now that this code is in place, there is no harm in always using the wms_srs to decide what projection a bbox should be output in... just want to note that this change is separate entirely from the wms_bbox_extended change.

comment:9 by havatv, 13 years ago

Cc: havatv added

Documentation of wms_bbox_extended added to the wms_server document for trunk and 6.0 in r12591.

Note: See TracTickets for help on using tickets.