Opened 18 years ago

Closed 18 years ago

#1916 closed defect (fixed)

bbox request different to the bbox received

Reported by: higon_jos@… Owned by: warmerdam
Priority: highest Milestone: 4.10 release
Component: GDAL Support Version: unspecified
Severity: normal Keywords:
Cc:

Description

I have a problem when I request a WMS-GetMap in mapserver 4.9 (FWtools
linux). I request a layer in tiff format with a specific bounding box
but the response doesn't have the same bounding box !!
For instance :
REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=cv_10m&SRS=EPSG:23030&BBOX=664090.8083832336,4397807.056545591,664791.4071856289,4398459.410520276&WIDTH=64&HEIGHT=64&FORMAT=image/tiff;%20mode=float32&STYLES=&TRANSPARENT=TRUE

but if I do "gdalinfo" ... I obtain

minx=664096.282 miny =4397812.153 , max = 664785.934  maxy = 4398454.314

You can get the mapfile in:
http://www.simoncit.cop.gva.es/~jvhigon/bug.map
and the datasource:
http://www.simoncit.cop.gva.es/~jvhigon/recorte.tif

Attachments (2)

bug.map (1.6 KB ) - added by higon_jos@… 18 years ago.
Mapfile
recorte.tif (855.7 KB ) - added by higon_jos@… 18 years ago.
Datasource, gtiff float32

Download all attachments as: .zip

Change History (4)

by higon_jos@…, 18 years ago

Attachment: bug.map added

Mapfile

by higon_jos@…, 18 years ago

Attachment: recorte.tif added

Datasource, gtiff float32

comment:1 by sdlime, 18 years ago

Cc: steve.lime@… added

comment:2 by fwarmerdam, 18 years ago

Milestone: 4.10 release
Resolution: fixed
Status: newclosed
Jose, 

I have confirmed there was an "off by one pixel width" error in the way
that the transformation (bounds) parameters for the output geotiff were
computed.  I have corrected this in msMapComputeGeotransform() in mapobject.c.
This fix will be in 4.10.0 RC1. 

The problem is that geotransform's need to be based on an a pixel transformation
model that goes to the edges of the image (map), as is the case for the BBOX.
However, the mapObj in MapServer uses extents that only go to the center of
the edge pixels.  This was not properly being accounted for when the
geotransform was computed, though it was properly taken into account by the
code that sets the mapObj.extent value from the WMS BBOX.

Mostly this change affects files saved using GDAL.  It could also potentially
alter resampling image results a bit when mapresample.c (raster
rotation/resampling) is applied. 

Note: See TracTickets for help on using tickets.