Java Mapscript Error
Stephen Jones
stephen.jones at VAISALA.COM
Fri Aug 10 10:01:39 PDT 2007
Hi,
I am hoping that someone is going to be able to help me out here.
I am using the Java version of mapscript, along with Tomcat to produce dynamic mapping for an application. Whilst coloring all features on a layer with the same color all is ok. Once I try to classify the features, the first client displays ok, but when another client invokes a session I get this error message
java.lang.UnknownError: loadSymbolSet(): Unknown identifier. Parsing error near (SYMBOL):(line 0)
at edu.umn.gis.mapscript.mapscriptJNI.mapObj_setSymbolSet(Native Method)
at edu.umn.gis.mapscript.mapObj.setSymbolSet(mapObj.java:461)
I have replicated this using a simple loop to draw my map as below
public void doMap(){
int j;
for (j=0;j<10;j++){
drawMap(j);
}
public void drawMap(int index){
String filename = "mapImg"+Integer.toString(index)+".jpg";
mapObj icemap = new mapObj("");
rectObj mainExtent = new rectObj(-77.1,38.85,-76.9,38.95,mapscriptConstants.MS_FALSE);
icemap.setExtent(mainExtent);
setPaths(icemap,index);
icemap.setHeight(800);
icemap.setWidth(800);
doImageColor(icemap);
webObj thisWeb = icemap.getWeb();
thisWeb.setImagepath("/var/maps/tmp/");
addLayerInfo(icemap,"Urban Area","ap",mapscriptConstants.MS_LAYER_POLYGON,mapscriptConstants.MS_ON,0,10000000,15657698,"NAME","georgia-bold",6,100000,50000000,0,0.0,0);
addthermalMap2(icemap);
imageObj mapImg = icemap.draw();
mapImg.save("/var/maps/tmp/"+filename,icemap);
icemap.delete();
}
In addLayerInfo I create a layer etc etc and define a class with an empty expression (ie all features)
classObj oMapClass = new classObj(aLayer);
oMapClass.setExpression("");
In addthermalMap2 I create an expression for an attrubute field frst as such
oMapClass.setExpression("([frst]>=3.0)");
The function setPath , sets the path to shapefiles, symbol & font files.
public void setPaths(mapObj icemap, int index){
icemap.setShapepath("/var/maps/shapefiles/");
System.out.println("Set Shape path");
icemap.setSymbolSet(symSet); // THIS IS THE LINE THAT CAUSES IT TO STOP
System.out.println("Set Symbol");
icemap.setFontSet("/var/maps/symbols/fonts.txt");
System.out.println("Set Font");
}
The second time around the loop setPath generates the error message. If i comment out the addthermalMap, it runs ok ? I have seen something similar posted for php/mapscript. Is there any way round this ? Have I missed the point and done something wrong ? Is it a known bug ? If so is it planned to fix it ? This is real urgent as I have a deadline of end of this month to have the first system out for test.
Thanks Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070810/514f8a64/attachment.htm>
More information about the MapServer-users
mailing list