Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#1982 closed defect (invalid)

zoomRectangle() consistency checks impossible to pass.

Reported by: rodrigo.andrade@… Owned by: sdlime
Priority: high Milestone:
Component: MapScript-SWIG Version: 4.10
Severity: normal Keywords:
Cc:

Description

On mapserver version 4.10, the file

$MAPSERVER_HOME/mapscript/swiginc/mapzoom.i on line 282 it reads:

        if (poPixRect->maxy >= poPixRect->miny)
  
This should be changed to 

        if (poPixRect->miny >= poPixRect->maxy)

As it is now, the use of mapObj.zoomRectangle will crash the app (for obvious
reasons).
I made the above mentioned changes on my files and the method worked fine then.

Thank you.

Change History (7)

comment:1 by rodrigo.andrade@…, 17 years ago

Severity: majornormal

comment:2 by sdlime, 17 years ago

Resolution: fixed
Status: newclosed
Fixed in both 4.10 branch and CVS head. (cleaned up a few other things too)
Please test if you can and confirm the fix.

Steve

comment:3 by sdlime, 17 years ago

Resolution: fixed
Status: closedreopened
Reopening...

comment:4 by sdlime, 17 years ago

Resolution: invalid
Status: reopenedclosed
This is working as intended, the pixel coordinates have the y's reversed (on
purpose) which is silly. Will look into fixing for 5.0 but not touching in 4.10.

Steve

comment:5 by hobu, 17 years ago

Steve,

I thought it was true that all pixel spaces have their origin in the top left
corner instead of the bottom left corner?  That would explain the reason
mapzoom.i is this way.  I think mapzoom.i is a port of some PHP convenience
stuff that Sean did.  What does PHP do?

comment:6 by sdlime, 17 years ago

Sean's stuff was a straight port of the PHP code. All pixel spaces do have an UL
origin, but we should worry about that not the user. We should just make it
clear that pixel space is that way but a rect is always minx, miny, maxx, maxy. 

There no reason the corners must match before and after. It's ok that minx, miny
in pixel space with become minx, maxy in map space.

Steve

comment:7 by dmorissette, 17 years ago

dependson: 1988
Note: See TracTickets for help on using tickets.