Negative values in extent

Daryl Herzmann akrherz at IASTATE.EDU
Tue Dec 14 06:48:40 PST 2004


Hello,

On Tue, 14 Dec 2004, [ISO-8859-2] Miroslav ?ulc wrote:

>Hi,
>
>I have upgraded to mapserver 4.4.0 and I am having problem with negative
>values in EXTENT in MAP file. I have maps in S-JTSK (Czech norm) and
>this is a system with negative values. Here is my EXTENT:
>
>EXTENT -747200 -1043200 -747000 -1046000
>
>These worked for me when I used the mapserver script. But I cannot make
>them work throught the php mapscript. Thought I finally "succeeded"
>(they appear in the $map->extent till next method is called) to get the
>negative extent to the map object, I still get error that the map cannot
>be drawn.
>
>Info: object(ms_rect_obj)#46 (5) { ["_handle_"]=> resource(361) of type
>(Unknown) ["minx"]=> int(-747200) ["miny"]=> int(-1043200) ["maxx"]=>
>int(-747000) ["maxy"]=> int(-1046000) }
>
>*Warning*: [MapServer Error]: msDrawMap(): Unable to initialize image.
>in
>*/var/www/intranet.centaur.startnet.cz/htdocs/modules/maps/CMap.cls.php*
>on line *106*
>
>*Warning*: [MapServer Error]: msCalculateScale(): Invalid image extent,
>minx=-1.000000, miny=-1.000000, maxx=-1.000000, maxy=-1.000000. in
>*/var/www/intranet.centaur.startnet.cz/htdocs/modules/maps/CMap.cls.php*
>on line *106*
>
>Here is my code (it's copied from the hello example):
>
>        $map = ms_newMapObj($this->m_Row['MapFilePath']);
>        $extent = ms_newRectObj();
>        $extent->minx = -747200;
>        $extent->miny = -1043200;
>        $extent->maxx = -747000;
>        $extent->maxy = -1046000;
>        $map->extent = $extent;
>        $image = $map->draw();
>        $map_file = $image->saveWebImage();
>
>Does Mapserver support negative values in extent? If not, is there any
>workaround? I will appreciate any suggestion.

$extent->maxy  needs to be greater than $extent->miny .  Try switching
them around and it should work...

HTH,
  daryl

--
/**
 * Daryl Herzmann (akrherz at iastate.edu)
 * Program Assistant -- Iowa Environmental Mesonet
 * http://mesonet.agron.iastate.edu
 */



More information about the MapServer-users mailing list