[mapserver-users] Customized layer for Mapserver/Kamap

Emilio Ponce yosoycore at gmail.com
Thu May 15 05:16:25 PDT 2008


Thank you very much Florin!

This code is very useful, is not exactly what I needs but gives me
orientation about how to implement my mapfile.



2008/5/14 Florin A. <pianosnake at gmail.com>:

> Hi,
>
> In your mapfile you define the layers and the colors. See example below.
>
> If you have an SRID (projection) for the layer use it.  You can see
> what it is by  selecting this sql  in pgadmin:  "select srid(the_geom)
> from cities)   .  Use the number you get here in the mapserver layer
> definition and in the projection definition as well.  If you loaded
> the cities with shp2pgsql then you should automatically have a gid
> field on the cities table.   And  your cities table should have a
> population field the type of which  should be some kind of number.
>
>
> LAYER
>        METADATA
>                "wms_title"  "Cities layer"
>        END
>        NAME "cities"
>        TRANSPARENCY 100
>        CONNECTIONTYPE postgis
>        CONNECTION "host=??? user=???  dbname=???  password='???'"
>        DATA "the_geom from cities using srid=???  USING UNIQUE gid"
>        TYPE POLYGON
>
>       CLASS
>                NAME "Small cities"
>                EXPRESSION ( [population] <50000)
>                COLOR 0 255 0
>        END
>
>        CLASS
>                NAME "Medium cities"
>                EXPRESSION ([population] >50000 AND [population] <1500000 )
>                COLOR 255 255 0
>        END
>
>        CLASS
>                NAME "Big cities"
>                EXPRESSION ([population] > 1500000 )
>                COLOR 255 0 0
>        END
>
>
> END
>
> Hope this helps,
> Florin
>



-- 
Emilio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080515/0b46583b/attachment.htm>


More information about the MapServer-users mailing list