<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>[UMN_MAPSERVER-USERS] Mutiple "DATA" lines in a single layer?</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1589" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
class=093234720-18052007>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.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
class=093234720-18052007></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
class=093234720-18052007>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.</SPAN></FONT></DIV><BR>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> UMN MapServer Users List 
  [mailto:MAPSERVER-USERS@LISTS.UMN.EDU] <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&nbsp;: [UMN_MAPSERVER-USERS] Mutiple "DATA " lines in a single 
  layer?<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV id=idOWAReplyText69176 dir=ltr>
  <DIV dir=ltr><FONT face=Verdana color=#000000 size=2>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</FONT></DIV>
  <DIV dir=ltr><FONT face=Verdana size=2></FONT>&nbsp;</DIV>
  <DIV dir=ltr>&nbsp;</DIV>
  <DIV dir=ltr><FONT face=Verdana color=#000000 size=2></FONT>&nbsp;</DIV></DIV>
  <DIV id=idSignature60065 dir=ltr>
  <DIV><FONT face=Arial color=#000000 
  size=2>---------------------------------------------</FONT></DIV>
  <DIV><FONT face=Arial size=2>Guillaume SUEUR</FONT></DIV>
  <DIV><FONT face=Arial size=2>Géosignal - Groupe BVA</FONT></DIV>
  <DIV><FONT face=Arial size=2>25bis Avenue Marcel Dassault</FONT></DIV>
  <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">BP 
  95836</SPAN></DIV>
  <DIV><FONT face=Arial size=2>31505 Toulouse CEDEX 05</FONT></DIV>
  <DIV><FONT face=Arial size=2>Tél : 05 61 17 47 17</FONT></DIV>
  <DIV><FONT face=Arial 
  size=2>---------------------------------------------</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></DIV>
  <DIV dir=ltr><BR>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><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><BR></DIV>
  <DIV>
  <P><FONT size=2>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.&nbsp; 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.&nbsp; But this requires that the layer be<BR>duplicated for each 
  scale range.&nbsp; 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>&nbsp;&nbsp; DATA 
  "simplify(the_geom, 1.0/&lt;scale&gt;) from streets"<BR><BR>Or am I stuck with 
  using multiple layers?<BR><BR></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>