Ticket #1916 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

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

bug.map Download (1.6 KB) - added by higon_jos@… 7 years ago.
Mapfile
recorte.tif Download (0.8 MB) - added by higon_jos@… 7 years ago.
Datasource, gtiff float32

Change History

Changed 7 years ago by higon_jos@…

Mapfile

Changed 7 years ago by higon_jos@…

Datasource, gtiff float32

Changed 7 years ago by sdlime

  • cc steve.lime@… added

Changed 7 years ago by fwarmerdam

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 4.10 release
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.