Problem with call to zoomRectangle() function in Python mapscript

Sean Gillies sgillies at FRII.COM
Fri Aug 27 06:53:17 PDT 2004


On Aug 27, 2004, at 7:41 AM, Bill Hudspeth wrote:

> I am experiencing an unknown problem with a call to the map object
> zoomRectangle() function in Python mapscript. My code looks like this:
> *************************************
> self.nmMap = mapscript.mapObj()
> self.img_width = self.nmMap.width
> self.img_height = self.nmMap.height
> self.prev_minx=45726.60           #utm coords
> self.prev_miny=3400000.0         #utm coords
> self.prev_maxx=785072.39         #utm coords
> self.prev_maxy=4153198.0         #utm coords
>
> self.down_x=240                         #pixel coords
> self.up_x=330                              #pixel coords
> self.down_y=145                         #pixel coords
> self.up_y=208                              #pixel coords
> prevExtent =mapscript.rectObj(float(self.prev_minx),
> float(self.prev_miny), float(self.prev_maxx), float(self.prev_maxy))
> zoomRect=mapscript.rectObj(min(float(self.down_x), float(self.up_x)),
> min(float(self.down_y), float(self.up_y)), max(float(self.down_x),
> float(self.up_x)), max(float(self.down_y), float(self.up_y)))
> self.nmMap.zoomRectangle(zoomRect, int(self.img_width),
> int(self.img_height), prevExtent, prevExtent)
> **************************************
>
> The error I am receiving is:
> ****************
> General error message. Georeferenced coordinates miny <= maxy.
> ***********************
> This message is a little cryptic - would appreciate any ideas on where
> to go with it.
>
> Thanks, Bill

Bill,

What version of MapServer are you using?  This is something that all
posters should mention immediately.  I'll assume 4.2.x.

Message says that your miny *must* be less than or equal to maxy.  In
your case, you are passing a maxy that is less than miny.  The
confusing thing is that it doesn't say which of the three input
rectObjs is at fault.

I'll improve the error message for the 4.2.3 release, if you will help
me out by entering a new bug in the MapServer issue tracker.  Use the
Mapscript-SWIG component.

    http://mapserver.gis.umn.edu/bugs/enter_bug.cgi

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies



More information about the MapServer-users mailing list