[mapserver-users] Coloring vectordata by features/infos

Michael G. michael.gajda at tu-dortmund.de
Sun Sep 4 13:35:06 EDT 2011


Hello,

I am rendering vectordata from a PostGIS database which works like a charm.
My layer definition looks like this:
    LAYER
        NAME "vector"
        METADATA
            "wms_include_items" "all"
            "wms_title" "dortmund_basic"
        END
        TEMPLATE gfi.html
        TYPE POLYGON
        ## Should be inherited from MAP level, but is good practice to have
here, too: ##(or not? <.<)
        #PROJECTION
        #   "init=epsg:900913"
        #END
        DUMP true

        CONNECTIONTYPE postgis
        CONNECTION "host=x dbname=x user=x password=x port=5432"
        DATA "the_geom FROM x"

        CLASS
            STYLE
                COLOR 200 50 50
                OUTLINECOLOR 60 60 60
                #SYMBOL 0
                ANTIALIAS true
                OPACITY 80  # in percent
            END
        END
    END

Right now, I have not fully grasped how features/information is saved along
with the vector data in the PostGIS database, but I am also not maintaining
it. Supposingly we will have a float-value saved along with every vector.
Can someone explain or give me hints, how I could map such a value which is
saved along into a color? Like a brighter shade of red the higher the value is?

Sincerely
Michael Gajda


More information about the mapserver-users mailing list