[mapserver-users] dynamic class creation vs. static

Stephen Woodbridge woodbri at swoodbridge.com
Tue Jun 11 19:58:18 EDT 2002


Pushkar,

Off hand is seems like you are approaching the problem from the wrong
direction, IE there is a different way to solve the problem. Only I'm
having trouble understanding how you data is organized.

For example, if I want to display cities I have a cities.shp file that
has the point locations of the cities and the name as an attribute. Then
I make a layer to display and label the cities. If I want different
symbols for say population then I set a a CLASS ITEM "POPULATION" and
set up CLASSes with EXPRESSIONs to display different symbols or circle
sizes based on the expression.

So what does your data look like and what do you wnat to do with it.
Clearly as you posted you don't want to declare 30 some classes.

-Steve

Pushkar Pradhan wrote:
> 
> I have a list of layers (~30 or more), I need to display only certain
> classes in each of these. There doesn't seem to be a criteria defined by
> my client, just a word file containing the names.
> 
> Static:
> Pasting the names of the classes in each layer in the .map file seems
> boring, i.e. in cities layer he wants 30 cities to be displayed.
> LAYER cities
> 
> CLASS1
> CLASS2
> ...
> CLASS30
> 
> END
> 
> similarly for all layers
> 
> Dynamic:
> I can take the layer name and look it up in a text file which contains the
> city names and then create all the classes in a loop:
> for(no. of cities in the text file) {
>    create new class obj.
>    set attributes
> }
> 
> Would the 1st approach be faster, I think in the 2nd approach the classes
> will be created each time a user zooms in or adds more classes, please
> advice. Thanks,
> 
> -Pushkar S. Pradhan



More information about the mapserver-users mailing list