the stranges symbolset file parsing error when using mapscript: loadSymbolSet(): Unknown identifier. Parsing error near (SYMBOL):(line 0)
Dolf Andringa
dolf.andringa at ELCYION.NL
Thu Jan 11 08:31:40 PST 2007
Hi people,
I am having the strangest problem. When setting a symbolsetfile to a
mapObj with mapscript in python, and in the same script creating a
classObj with an expression, I get an error: mapscript.MapServerError:
loadSymbolSet(): Unknown identifier. Parsing error
I limited the error down to a small testscrip which is below. If I
remove eiter one of the last two lines in the script, the error
disappears. In the original script also layers and stuff (connection
through ogr to postgres/postgis) are added, but that makes no
difference. I also included my symbols file (see below). I added a BOF
and EOF below to show the beginning and ends of the files, of course
they are not in the actual files. The full traceback of the python error
can be seen below as well. I am running Python 2.4.4 on Debian Sarge
with a self compiled version of mapserver 4.10.0, gdal 1.3.2 and proj 4.5.0.
I have no idea what the problem is. I hope anybody can help.
Thanks,
Dolf.
testscript.py:
BOF
import mapscript
mapobj=mapscript.mapObj()
outputFormat=mapscript.outputFormatObj("GD/PNG")
outputFormat.name="png24"
outputFormat.setMimetype("image/png")
outputFormat.imagemode=1
outputFormat.setExtension("png")
mapobj.legend.status=1
mapobj.legend.keysizex=100
mapobj.legend.keysizey=30
mapobj.legend.keyspacingy=20
mapobj.legend.width=100
mapobj.setSize(600,1200)
mapobj.setExtent(132771,447652,134477,451064)
mapobj.setOutputFormat(outputFormat)
style=mapscript.styleObj()
style.symbolname="point5"
style.color=mapscript.colorObj(225,0,0)
cls=mapscript.classObj()
cls.insertStyle(style)
cls.name="testclass"
cls.setExpression("(4 + 4)")
mapobj.setSymbolSet('test_symbols.set')
EOF
test_symbols.set file:
BOF
SYMBOL
NAME "point5"
TYPE ELLIPSE
FILLED true
POINTS
5 5
END
END
EOF
Python error:
Traceback (most recent call last):
File "testscript.py", line 39, in ?
mapobj.setSymbolSet('test_symbols.set')
File "/usr/lib/python2.4/site-packages/mapscript.py", line 1382, in
setSymbolSet
def setSymbolSet(*args): return _mapscript.mapObj_setSymbolSet(*args)
_mapscript.MapServerError: loadSymbolSet(): Unknown identifier. Parsing
error near (SYMBOL):(line 0)
More information about the MapServer-users
mailing list