<HTML>
<HEAD>
<TITLE>Re: [UMN_MAPSERVER-USERS] RE : [UMN_MA PSERVER-USERS] Mutiple "DATA " 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. That will let them appear to the client as a single logical layer using the GROUP name you specified.<BR>
<BR>
- 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 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 <jdege@KORTERRA.COM><BR>
<B>Reply-To: </B>Jeff Dege <jdege@KORTERRA.COM><BR>
<B>Date: </B>Fri, 18 May 2007 15:51:34 -0500<BR>
<B>To: </B><MAPSERVER-USERS@LISTS.UMN.EDU><BR>
<B>Conversation: </B>[UMN_MAPSERVER-USERS] RE : [UMN_MAPSERVER-USERS] Mutiple "DATA " lines in a single layer?<BR>
<B>Subject: </B>Re: [UMN_MAPSERVER-USERS] RE : [UMN_MA PSERVER-USERS] Mutiple "DATA " lines in a single l ayer?<BR>
<BR>
<FONT COLOR="#0000FF">We're using OpenLayers as the map viewer. MapServer will be running in CGI mode, either directly or as a WMS server. So mapscript isn't part of the equation.<BR>
</FONT> <BR>
<FONT COLOR="#0000FF">I've never looked at the 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>
<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 [<a href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU]">mailto:MAPSERVER-USERS@LISTS.UMN.EDU]</a> <B>On Behalf Of </B>Guillaume SUEUR<BR>
<B>Sent:</B> Friday, May 18, 2007 3:04 PM<BR>
<B>To:</B> MAPSERVER-USERS@LISTS.UMN.EDU<BR>
<B>Subject:</B> [UMN_MAPSERVER-USERS] RE : [UMN_MAPSERVER-USERS] Mutiple "DATA " lines in a single layer?<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"><BR>
<BR>
<BR>
<BR>
as Stephen said, there is only ONE data statement per layer. But, if you use mapscript, you can change it dynamically depending on the scale for example<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<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é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 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é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>
<BR>
<BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="100%"> </FONT><FONT FACE="Tahoma"><B>De:</B> UMN MapServer Users List de la part de Jeff Dege<BR>
<B>Date:</B> ven. 18/05/2007 20:32<BR>
<B>À:</B> MAPSERVER-USERS@LISTS.UMN.EDU<BR>
<B>Objet :</B> [UMN_MAPSERVER-USERS] Mutiple "DATA" lines in a single layer?<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"><BR>
<BR>
<BR>
<BR>
I'm starting to play around with using MapServer to serve maps from a<BR>
PostGIS database.<BR>
<BR>
One of the features that MapServer has is that you can define multiple<BR>
classes within a single layer, so you can change the way that the map<BR>
looks when drawn at different scales/resolutions.<BR>
<BR>
Is there some way to define multiple data sources within a single layer,<BR>
so that I can change how that data is obtained at different layers?<BR>
<BR>
In particular, I'm wondering how to best take advantage of PostGIS's<BR>
simplify() function - which can be used to reduce the number of points<BR>
included in a geometry based on resolution. If I'm drawing a map at a<BR>
resolution where one pixel equals 2000 meters on the ground, there is no<BR>
advantage to sending the viewer a geometry defined with points<BR>
twenty-five meters apart.<BR>
<BR>
The obvious way is to define multiple layers, each enabled at certain<BR>
scales, and to include the resulution appropriate for those scales in<BR>
the DATA keyword's sql statement. But this requires that the layer be<BR>
duplicated for each scale range. Is there a way to enable different<BR>
DATA sql statements at different scales/resolutions in a single layer<BR>
definition?<BR>
<BR>
I don't see the DATA keyword in the documentation for the CLASS section.<BR>
Which is where I'd expect it to be if I could do what I want.<BR>
<BR>
Is there a way of including a value calculated from the scale in the SQL<BR>
statement within the LAYER section?<BR>
<BR>
DATA "simplify(the_geom, 1.0/<scale>) from streets"<BR>
<BR>
Or am I stuck with using multiple layers?<BR>
<BR>
</FONT></SPAN></BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"><BR>
</FONT></SPAN>
</BODY>
</HTML>