[mapserver-users] Class limit and Mapscript

Homme Zwaagstra hrz at geodata.soton.ac.uk
Wed May 8 15:10:04 EDT 2002


Dear List,

I've noticed that MS_MAXCLASSES in map.h defines a limit of 50 classes per layer. Using 
PHP mapscript I've written some code that exceeds this limit with the result that I get a 
crash with "Fatal error: MapServer Error in msSearchDiskTree()". I'm wondering whether the 
fact that I'm exceeding the limit means that there's way to solve my problem other 
than changing MS_MAXCLASSES and recompiling.

What I am trying to do is dynamically set the size of each point in a layer and to do this it 
seems I have to create a class relating specifically to that point. Or am I wrong? The code 
relating to the creation of the classes follows:

--- code snippet ----------------------------------------

# $reports is an associative array containing data relating to specific points in a layer

$i = 1; # counter
foreach ($reports as $code => $value) { # iterate through data creating a class for each point
	print "$i [$code] = $value<br/>\n"; # debugging output
	$class = ms_newClassObj($layer); # instantiate new class object
	$size = ($value * 3) + 10; # create multiplier
	$class->set('size', $size); # set the size of the symbol
	$class->set('maxsize', $size);
	$class->set('minsize', $size);
	$class->set('symbol', $sym_id);
	$class->set('name', $code);
	$class->set('outlinecolor', $outline);
	$class->set('color', $colour);
	$class->setexpression("('[N2]' eq '$code')"); # set expression so that only the relevant point is drawn
	$i++;
}

--------------------------------------------------------------

Thanks in advance for any insights!

Homme Zwaagstra.





More information about the mapserver-users mailing list