Opened 11 years ago

Closed 11 years ago

#2312 closed defect (fixed)

WMS request fails for Drawing Source Layer

Reported by: fare Owned by:
Priority: medium Milestone:
Component: WMS Interface Version: 2.5.0
Severity: major Keywords: wms, fail, bbox
Cc: External ID:

Description

WMS request will fail with following code if request BBOX is outside BBOX that is defined for layer.

- MgFeatureServiceHandler.ProcessOperation() line 83 file
c:\mg-2.5-x64\mgdev\server\src\services\feature\FeatureServiceHandler.cpp
- MgOpGetClassDefinition.Execute() line 153 file
c:\mg-2.5-x64\mgdev\server\src\services\feature\OpGetClassDefinition.cpp
- MgServerDescribeSchema.GetClassDefinition() line 1039 file
c:\mg-2.5-x64\mgdev\server\src\services\feature\ServerDescribeSchema.cpp

This is happening if source layer is Drawing Layer.

For example if layer has bbox that is defined as <Bounds west="6452734.8225" east="6457584.8225" south="4876898.3721" north="4882648.3721" SRS="EPSG:31276" />

the following request will fail (bbox is outside)

http://localhost:8008/mapguide/mapagent/mapagent.fcgi?SERVICE=WMS&LAYERS=Layers%2FTest&FORMAT=image%2Fpng&TRANSPARENT=FALSE&HEIGHT=512&BGCOLOR=0xFFFFFF&REQUEST=GetMap&BBOX=6455650.23,4880154.08,6457991.78,4883029.08&WIDTH=417&STYLES=&SRS=EPSG:31276&VERSION=1.1.1

Attachments (1)

2312.patch (12.9 KB ) - added by jng 11 years ago.
Proposed patch

Download all attachments as: .zip

Change History (3)

comment:1 by fare, 11 years ago

The problem is in WMSMapUtil.cpp file of HTTPHandler. From line 181 there is comment regarding optimization code. The optimization start with checking that bbox of layer is inside request bbox.

if(wmsLayerExtent->Contains(extents)){

but problem occur if request bbox is shifted or larger that bbox of layer. Code goes to create sptial query filter on data.

But there is no check if it's dealing with Drawing Source layer!!!. Request fails on following line

Ptr<MgClassDefinition> classDef = featureService->GetClassDefinition(fsId,schemaName,className);

since there is no schema or class name for drawing layer.

This section of code needs revisit.

For work around I'm checking mgLayer->GetFeatureClassName() and if it's empty and just continue rendering.(as I understood Drawing Layer doesn't have this set)

if(wmsLayerExtent->Contains(extents) || mgLayer->GetFeatureClassName().empty())

I'm not sure what is proper way to patch this up?

by jng, 11 years ago

Attachment: 2312.patch added

Proposed patch

comment:2 by jng, 11 years ago

Resolution: fixed
Status: newclosed

Fixed trunk (r7752), 2.5 (r7753) and 2.4 (r7754)

Note: See TracTickets for help on using tickets.