[mapserver-users] layer classification with MapScript

Mr. Puneet Kishor punk.kish at gmail.com
Sat Aug 27 19:02:19 EDT 2011


I have a layer classification issue. I want to do something along the lines of (semi-pseudocode ahead) --

    $layerObj->{data} = 'the_geom FROM (SELECT gid, the_geom, class_name, class_color FROM table) t USING UNIQUE gid';
    $layerObj->{classitem} = 'class_name';
    
    while (my $row in $layerObj->{data}) {
        create class with 'name = class_name', 'expression = class_name', 'color = class_color'
    }

How do I iterate over the rows retrieved from the table in order to create classes? I don't see any obvious reference to a db result set.


More information about the mapserver-users mailing list