12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>45 / 3105.1.4 ExamplesLets start with a simple example and work our way up. Consider the following MapServer layer definition:LAYERCONNECTIONTYPE postgisNAME "roads"CONNECTION "user=theuser password=thepass dbname=thedb host=theserver"DATA "the_geom from roads"STATUS ONTYPE LINECLASSSTYLECOLOR 0 0 0ENDENDENDThis layer will display all the road geometries in the roads table as black lines.Now lets say we want to show only the highways until we get zoomed in to at least a 1:100000 scale - the next two layers willachieve this effect:LAYERCONNECTIONTYPE postgisCONNECTION "user=theuser password=thepass dbname=thedb host=theserver"PROCESSING "CLOSE_CONNECTION=DEFER"DATA "the_geom from roads"MINSCALE 100000STATUS ONTYPE LINEFILTER "road_type = ’highway’"CLASSCOLOR 0 0 0ENDENDLAYERCONNECTIONTYPE postgisCONNECTION "user=theuser password=thepass dbname=thedb host=theserver"PROCESSING "CLOSE_CONNECTION=DEFER"DATA "the_geom from roads"MAXSCALE 100000STATUS ONTYPE LINECLASSITEM road_typeCLASSEXPRESSION "highway"STYLEWIDTH 2COLOR 255 0 0ENDENDCLASSSTYLECOLOR 0 0 0ENDENDENDThe first layer is used when the scale is greater than 1:100000, and displays only the roads of type "highway" as black lines. TheFILTER option causes only roads of type "highway" to be displayed.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!