python mapscript segfault

John Cartwright John.C.Cartwright at NOAA.GOV
Wed Nov 8 23:53:39 EST 2006


Hello All,

I'm trying to use python mapscript (4.10.0) on MacOS 10.4 to create a
map dynamically and output the image.  Code seems to segfault at the
termination of the program.  Can anyone see what I'm doing wrong or
suggest a method of tracing the problem?

Thanks!

-- john


import mapscript;

map = mapscript.mapObj()
map.name = "CustomMap"
map.setSize(600,300)
map.setExtent(-180.0,-90.0,180.0,90.0)
map.imagecolor.setRGB(180,180,250)
map.units = mapscript.MS_DD

layer = mapscript.layerObj(map)
layer.name = "countries"
layer.type = mapscript.MS_LAYER_POLYGON
layer.status = mapscript.MS_DEFAULT
layer.data = "/usr/local/shapefiles/country.shp"

class1 = mapscript.classObj(layer)
class1.name = "Countries"

style = mapscript.styleObj(class1)
style.outlinecolor.setRGB(100,100,100)
style.color.setRGB(200,200,200)

map_image = map.draw()
filename = 'test.' + map_image.format.extension
map_image.save(filename)



More information about the mapserver-users mailing list