[Mapserver-users] setExpression difficulty
Nick Petersen-Bergeron
bergeron at zedxinc.com
Wed Oct 15 06:13:52 PDT 2003
Yup. It gets rid of the error, but I think it doesn't actually set the
expression.
Nick
At 09:02 AM 10/15/2003 -0400, Lowell Filak wrote:
>Have you already tried '$tempClass->setExpression("\"$key\"");' ?
>Lowell
>
>The following message was sent by Nick Petersen-Bergeron
><bergeron at zedxinc.com> on Tue, 14 Oct 2003 14:16:06 -0400.
>
> > I'm trying to dynamically create classes in a layer using Perl
>mapscript 3.6.
> >
> > Here's my code:
> >
> > foreach $key (sort keys %colors) {
> > my $tempClass = new classObj($soilLayer);
> > $tempClass->setExpression("$key");
> > $tempClass->{name} = $key;
> > $tempClass->{size}=5;
> > my $r = $colors{$key}{'R'};my $g = $colors{$key}{'G'};my
> > $b = $colors{$key}{'B'};
> >
> > my $rgb = 0;
> > foreach $clr ($r,$g,$b) {
> > $rgb <<=8;
> > $rgb += $clr;
> > }
> > warn "$rgb\n";
> > $tempClass->{color} = $rgb;
> > }
> >
> > $key is essentially the datum that I am looking to assign the different
> > shapes to different classes by. It is set up as the classitem in the
> > layer. Now, the problem is that when I try and use setExpression, I get
> > the following error:
> >
> > getSymbol(): Symbol definition error. (083028):(237)
> >
> > The first number(083028) is the piece of datum I'm passing in, $key. The
> > second is the last non-end line of the mapfile. Any ideas?
> >
> >
> >
> >
> >
> > Nick Petersen-Bergeron
> > System Administrator
> >
> > ZedX Inc.
> > 369 Rolling Ridge Drive
> > Bellefonte, PA. 16823
> >
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu
> > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list