<HTML>
<HEAD>
<TITLE>Re: [UMN_MAPSERVER-USERS] RE : [UMN_MA PSERVER-USERS] Mutiple &quot;DATA &quot; lines in a single l ayer?</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Jeff -<BR>
<BR>
Just use multiple layers in the map file, with a GROUP statement for each, and a MINSCALE/MAXSCALE value in each. &nbsp;That will let them appear to the client as a single logical layer using the GROUP name you specified.<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Ed<BR>
<BR>
-- <BR>
Ed McNierney<BR>
President and Chief Mapmaker<BR>
Maps a la carte, Inc. / TopoZone.com<BR>
73 Princeton Street, Suite 305<BR>
North Chelmsford, MA &nbsp;01863<BR>
Phone: (978) 251-4242<BR>
Fax: (978) 251-1396<BR>
ed@topozone.com<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"><B>From: </B>Jeff Dege &lt;jdege@KORTERRA.COM&gt;<BR>
<B>Reply-To: </B>Jeff Dege &lt;jdege@KORTERRA.COM&gt;<BR>
<B>Date: </B>Fri, 18 May 2007 15:51:34 -0500<BR>
<B>To: </B>&lt;MAPSERVER-USERS@LISTS.UMN.EDU&gt;<BR>
<B>Conversation: </B>[UMN_MAPSERVER-USERS] RE : [UMN_MAPSERVER-USERS] Mutiple &quot;DATA &quot; lines in a single layer?<BR>
<B>Subject: </B>Re: [UMN_MAPSERVER-USERS] RE : [UMN_MA PSERVER-USERS] Mutiple &quot;DATA &quot; lines in a single l ayer?<BR>
<BR>
<FONT COLOR="#0000FF">We're using OpenLayers as the map viewer. &nbsp;MapServer will be running in CGI mode, either directly or as a WMS server. &nbsp;So mapscript isn't part of the equation.<BR>
</FONT> <BR>
<FONT COLOR="#0000FF">I've never looked at the &nbsp;MapServer source, but I'm wondering if allowing DATA statements to be placed in CLASS sections would be a reasonable enhancement.<BR>
</FONT><BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
&nbsp;<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="100%"> </SPAN></FONT><SPAN STYLE='font-size:12.0px'><FONT FACE="Tahoma"><B>From:</B> UMN MapServer Users List &nbsp;[<a href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU]">mailto:MAPSERVER-USERS@LISTS.UMN.EDU]</a> <B>On Behalf Of </B>Guillaume &nbsp;SUEUR<BR>
<B>Sent:</B> Friday, May 18, 2007 3:04 PM<BR>
<B>To:</B> &nbsp;MAPSERVER-USERS@LISTS.UMN.EDU<BR>
<B>Subject:</B> [UMN_MAPSERVER-USERS] &nbsp;RE : [UMN_MAPSERVER-USERS] Mutiple &quot;DATA &quot; lines in a single &nbsp;layer?<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"><BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
as Stephen said, there is &nbsp;only ONE data statement per layer. But, if you use mapscript, you can change &nbsp;it dynamically depending on the scale for example<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
</FONT><FONT FACE="Arial">---------------------------------------------<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"> <BR>
</FONT><FONT FACE="Arial">Guillaume SUEUR<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"> <BR>
</FONT><FONT FACE="Arial">G&eacute;osignal - Groupe BVA<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"> <BR>
</FONT><FONT FACE="Arial">25bis Avenue Marcel Dassault<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"> <BR>
</FONT></SPAN><FONT FACE="Verdana, Helvetica, Arial"><FONT COLOR="#000080"><FONT SIZE="4"><SPAN STYLE='font-size:13.0px'>BP &nbsp;95836<BR>
</SPAN></FONT></FONT><SPAN STYLE='font-size:12.0px'> <BR>
</SPAN></FONT><SPAN STYLE='font-size:12.0px'><FONT FACE="Arial">31505 Toulouse CEDEX 05<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"> <BR>
</FONT><FONT FACE="Arial">T&eacute;l : 05 61 17 47 17<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"> <BR>
</FONT><FONT FACE="Arial">---------------------------------------------<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"> <BR>
&nbsp;<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="100%"> </FONT><FONT FACE="Tahoma"><B>De:</B> UMN MapServer Users List de la part de &nbsp;Jeff Dege<BR>
<B>Date:</B> ven. 18/05/2007 20:32<BR>
<B>&Agrave;:</B> &nbsp;MAPSERVER-USERS@LISTS.UMN.EDU<BR>
<B>Objet :</B> [UMN_MAPSERVER-USERS] Mutiple &nbsp;&quot;DATA&quot; lines in a single layer?<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"><BR>
&nbsp;<BR>
&nbsp;<BR>
<BR>
I'm starting to play around with using MapServer to serve maps &nbsp;from a<BR>
PostGIS database.<BR>
<BR>
One of the features that MapServer has is &nbsp;that you can define multiple<BR>
classes within a single layer, so you can &nbsp;change the way that the map<BR>
looks when drawn at different &nbsp;scales/resolutions.<BR>
<BR>
Is there some way to define multiple data sources &nbsp;within a single layer,<BR>
so that I can change how that data is obtained at &nbsp;different layers?<BR>
<BR>
In particular, I'm wondering how to best take &nbsp;advantage of PostGIS's<BR>
simplify() function - which can be used to reduce &nbsp;the number of points<BR>
included in a geometry based on resolution. &nbsp;If &nbsp;I'm drawing a map at a<BR>
resolution where one pixel equals 2000 meters on the &nbsp;ground, there is no<BR>
advantage to sending the viewer a geometry defined with &nbsp;points<BR>
twenty-five meters apart.<BR>
<BR>
The obvious way is to define &nbsp;multiple layers, each enabled at certain<BR>
scales, and to include the &nbsp;resulution appropriate for those scales in<BR>
the DATA keyword's sql &nbsp;statement. &nbsp;But this requires that the layer be<BR>
duplicated for each &nbsp;scale range. &nbsp;Is there a way to enable different<BR>
DATA sql statements &nbsp;at different scales/resolutions in a single layer<BR>
definition?<BR>
<BR>
I &nbsp;don't see the DATA keyword in the documentation for the CLASS &nbsp;section.<BR>
Which is where I'd expect it to be if I could do what I &nbsp;want.<BR>
<BR>
Is there a way of including a value calculated from the scale in &nbsp;the SQL<BR>
statement within the LAYER section?<BR>
<BR>
&nbsp;&nbsp;&nbsp;DATA &nbsp;&quot;simplify(the_geom, 1.0/&lt;scale&gt;) from streets&quot;<BR>
<BR>
Or am I stuck with &nbsp;using multiple layers?<BR>
<BR>
</FONT></SPAN></BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"><BR>
</FONT></SPAN>
</BODY>
</HTML>