[mapserver-users] How set the extent programmmatically using python mapscript

Andrea Peri aperi2007 at gmail.com
Sun Nov 15 23:51:41 PST 2015


Hi ,
I try unsuccesfully to programmatically set the extent of a layer
using mapscript python.

I use this code to set the extent variable:

    #... "extent1" is a variable storing the extent I like to set.

    print("Add this extent to the layer: %s\n" % (str(extent1)))
    clone_map_getlayer_li.extent = extent1
    print("The result of add is this: %s\n" %
(str(clone_map_getlayer_li.extent)))
    ....

But
The result from printf show that the extent is not update.


>Add this extent to the layer: { 'minx': 424785 , 'miny': 4662585 , 'maxx': 696015 , 'maxy': 5057415 }

>The result of add is this: { 'minx': -1 , 'miny': -1 , 'maxx': -1 , 'maxy': -1 }

What I'm wrong ?

Many thx for any help.

A.



-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------



More information about the MapServer-users mailing list