Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3083 closed defect (fixed)

When a GetCoverage request is sent to a WCS 1.0.0 server with a bbox that is the same as the defined bbox (describecoverage), the server must NOT return an exception

Reported by: nsavard Owned by: sdlime
Priority: normal Milestone: 5.4.3 release
Component: WCS Server Version: 5.4
Severity: normal Keywords: ogc, cite, test, wcs, 1.0.0
Cc: tomkralidis, assefa, warmerdam

Description

A request to a WCS 1.0.0 server with a bbox that is the same as the one returned by a describecoverage operation, must NOT return an exception.

The relevant test is:

wcs1-0-0:getcoverage_operations-getcoverage_request-response_crs-get-kvp-2

The defined bbox is:

    <gml:Envelope srsName="EPSG:4326">

        <gml:pos>-97.7071758865421 41.0324719184183</gml:pos> <gml:pos>-80.6778361148771 49.6650665681236</gml:pos>

    </gml:Envelope>

and the GetCoverage? request is:

http://dev1.lan.mapgears.com/manwe/cgi-bin/mswcs100_ogc_cite?&CrS=EPSG:4326&SeRvIcE=WCS&ReQuEsT=GetCoverage&WiDtH=200&BbOx=-97.7071758865421,41.0324719184183,-80.6778361148771,49.6650665681236&FoRmAt=GeoTIFF&VeRsIoN=1.0.0&CoVeRaGe=ndvi&HeIgHt=100&ReSpOnSe_cRs=EPSG:26915

The response is:

<?xml version='1.0' encoding="ISO-8859-1" ?>
<ServiceExceptionReport version="1.2.0"
xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net//wcs/1.0.0/OGC-exception.xsd">
  <ServiceException code="NoApplicableCode" locator="bbox">msWCSGetCoverage(): WCS server error. Requested BBOX (-97.7071758865421,41.0324719184183,-80.6778361148771,49.6650665681236) is outside requested coverage BBOX (159707,4597895,1400207,5501395)
  </ServiceException>
</ServiceExceptionReport>

Attachments (1)

3083.patch (12.0 KB ) - added by sdlime 15 years ago.
Patch for mapwcs.c aginst the 5.4 branch…

Download all attachments as: .zip

Change History (13)

comment:1 by sdlime, 15 years ago

Where can I get relevant mapfiles? Looks like a projection problem. The error message tells me the input bbox isn't being reprojected into the layer extent and the overlap test fails as a result.

Steve

comment:2 by nsavard, 15 years ago

Steve: I'm sending you an email with an URL from where to download the map file.

comment:3 by nsavard, 15 years ago

Steve: Any update on this one?

comment:4 by sdlime, 15 years ago

Working on it. No resolution yet.

Steve

comment:5 by sdlime, 15 years ago

Status: newassigned

comment:6 by sdlime, 15 years ago

Cc: warmerdam added

Ok, I think I know what's going on, projection problems. This request sets both crs and response_crs and I don't believe the bbox is being projected correctly before being used. That's why you see the EPSG:4326 coordinates in the exception.

In mapwcs.c there's a block of code that starts:

  /* handle the response CRS, that is, set the map object projection */
  if(params->response_crs || params->crs ) {

That code sets the map->projection based on crs or response_crs. In this case the map->projection becomes EPSG:26915. However, our bbox is still in EPSG:4326 and doesn't get projected to the map->projection anywhere.

So, later in the code there's a comment "if necessary, project the BBOX" comment but no code directly associated with it. Seems like if both crs and response_crs is set we should project the bbox from crs to response_crs (which would be map->projection based on the earlier block). Something like this might work:

  if(params->response_crs && params->crs) {
    projectionObj tmp_proj;

    msInitProjection(&tmp_proj);
    if (msLoadProjectionString(&tmp_proj, (char *) params->crs) != 0)
      return msWCSException( map, NULL, NULL, params->version);
    msProjectRect(&tmp_proj, &map->projection, &(params->bbox));
    msFreeProjection(&tmp_proj);
  }

At this point the bbox is in the map->projection and we're good to go. I tested with this and it did get past the overlap test where it had been failing. I don't know what down stream effects there might be or if the re-projection is in the right place. I'll attach a patch against the 5.4 branch so you can try it. (the patch is largish because I condensed a bunch of multi-line statements so I could read things easier)

Seems like this would have cropped up before with other CITE tests that set crs and response_crs. Must not be done often.

Steve

by sdlime, 15 years ago

Attachment: 3083.patch added

Patch for mapwcs.c aginst the 5.4 branch...

comment:7 by nsavard, 15 years ago

Steve, tested, it works with the OGC CITE tests. Thank you.

comment:8 by sdlime, 15 years ago

All the other tests are good then I take it. I'll commit tonite unless there are any comments or objections.

Steve

comment:9 by tomkralidis, 15 years ago

+1. Does this affect msautotest WCS tests in any way?

comment:10 by nsavard, 15 years ago

Comment:9 Tom I'll check and report back.

comment:11 by sdlime, 15 years ago

Resolution: fixed
Status: assignedclosed

Committed in 5.4 branch (r9287) and trunk (r9288). Closing for now.

Steve

comment:12 by nsavard, 15 years ago

comment:9

I ran the msautotest yesterday and I could not see any problem related to this change.

Note: See TracTickets for help on using tickets.