legend generation

Eijnden, Bart van den (AGI) b.vdeijnden at AGI.RWS.MINVENW.NL
Thu Dec 21 10:17:39 EST 2006


You need to use NAME instead of TITLE in the CLASS definition.

E.g.:

     CLASS
       EXPRESSION (([HUISNUMMER]^2 <= 4) OR ( [HUISNUMMER]^2=9 ))
       METADATA
       END
       STYLE
         ANGLE 360
         COLOR 255 0 0
         SYMBOL 2
       END
       NAME "huisnummer <= 3"
     END

Bart

-----Oorspronkelijk bericht-----
Van: UMN MapServer Users List
[mailto:MAPSERVER-USERS at LISTS.UMN.EDU]Namens Dolf Andringa
Verzonden: donderdag 21 december 2006 16:04
Aan: MAPSERVER-USERS at LISTS.UMN.EDU
Onderwerp: [UMN_MAPSERVER-USERS] legend generation


Hi People,

I don't understand legends I think. I have found the mapfile reference 
and mapscript API reference, but can't get this to work.
I have got a map file (see below). When I try to create a legend for it 
with the mapserver legend tool, or by using mapscript 
(someMapObj.drawLegend().save(filename)), I only get a very small empty 
image. The map itself is displayed correctly with blue and red points. 
What is needed to create a legend. What am I doing wrong? I don't know 
where to look.
Thanks,

Dolf.

EXTENT 132771 447652 134477 451064
   IMAGECOLOR 255 255 255
   IMAGETYPE png24
   SYMBOLSET "symbols2.set"
   SIZE 600 1200
   STATUS ON
   UNITS METERS
   NAME "HAGIS map"

   LEGEND
     KEYSIZE 20 10
     LABEL
       SIZE MEDIUM
       TYPE BITMAP
       COLOR 0 0 89
     END
     STATUS ON
   END

   LAYER
     CONNECTION "PG:*****"
     CONNECTIONTYPE OGR
     DATA "promedico_acni_ds.lw"
     DEBUG ON
       METADATA
       END
     NAME "lw"
     SIZEUNITS PIXELS
     STATUS ON
     TOLERANCEUNITS PIXELS
     TYPE POINT
     UNITS METERS
     CLASS
       EXPRESSION (([HUISNUMMER]^2 <= 4) OR ( [HUISNUMMER]^2=9 ))
       METADATA
       END
       STYLE
         ANGLE 360
         COLOR 255 0 0
         SYMBOL 2
       END
       TITLE "huisnummer <= 3"
     END
     CLASS
       METADATA
       END
       STYLE
         ANGLE 360
         COLOR 0 0 255
         SYMBOL 2
       END
       TITLE "overig"
     END
   END


Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te 
informeren. Wij adviseren u om bij twijfel over de juistheid of de 
volledigheid van de mail contact met afzender op te nemen.

This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************



More information about the mapserver-users mailing list