<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><br><div>
<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style>
<div dir="ltr">I'm pretty sure that END is correctly ending the Symbol Clause.<div><br></div><div>The odd thing about this is I can draw all four layers if I call them separately but when I try to </div><div>call them through php only numbers 1 and 3 work. All layers were generated the same way in</div><div>postgresql/postgis (see sql below).</div><div><br></div><div>I'm going to regenerate layers 2 and 4 just in case but I think it's a problem with php/ms_script.</div><div><br></div><div><p class="ecxMsoNormal" style="">// All these
work</p>
<p class="ecxMsoNormal" style=""><a href="http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business1.map&layers=business_rd1%20states&mode=map" target="_blank">http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business1.map&layers=business_rd1%20states&mode=map</a></p>
<p class="ecxMsoNormal" style=""><a href="http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business2.map&layers=business_rd2%20states&mode=map" target="_blank">http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business2.map&layers=business_rd2%20states&mode=map</a></p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business3.map&layers=business_rd3%20states&mode=map" target="_blank">http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business3.map&layers=business_rd3%20states&mode=map</a></p>
<p class="ecxMsoNormal" style=""><a href="http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business4.map&layers=business_rd4%20states&mode=map" target="_blank">http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business4.map&layers=business_rd4%20states&mode=map</a></p>
<p class="ecxMsoNormal" style=""> </p>
<p class="ecxMsoNormal" style="">// Half of
these work</p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/business.php?num=1" target="_blank">http://mapserver0/business.php?num=1</a> works</p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/business.php?num=2" target="_blank">http://mapserver0/business.php?num=2</a> not</p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/business.php?num=3" target="_blank">http://mapserver0/business.php?num=3</a> works</p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/business.php?num=4" target="_blank">http://mapserver0/business.php?num=4</a> not</p><div><br></div><div><br></div><p class="ecxMsoNormal" style="">// All these
work</p>
<p class="ecxMsoNormal" style=""><a href="http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business1.map&layers=business_rd1%20states&mode=map" target="_blank">http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business1.map&layers=business_rd1%20states&mode=map</a></p>
<p class="ecxMsoNormal" style=""><a href="http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business2.map&layers=business_rd2%20states&mode=map" target="_blank">http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business2.map&layers=business_rd2%20states&mode=map</a></p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business3.map&layers=business_rd3%20states&mode=map" target="_blank">http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business3.map&layers=business_rd3%20states&mode=map</a></p>
<p class="ecxMsoNormal" style=""><a href="http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business4.map&layers=business_rd4%20states&mode=map" target="_blank">http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business4.map&layers=business_rd4%20states&mode=map</a></p>
<p class="ecxMsoNormal" style=""> </p>
<p class="ecxMsoNormal" style="">// Half of
these work</p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/business.php?num=1" target="_blank">http://mapserver0/business.php?num=1</a> works</p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/business.php?num=2" target="_blank">http://mapserver0/business.php?num=2</a> not</p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/business.php?num=3" target="_blank">http://mapserver0/business.php?num=3</a> works</p>
<p class="ecxMsoNormal" style=""><a href="http://mapserver0/business.php?num=4" target="_blank">http://mapserver0/business.php?num=4</a> not</p><p class="ecxMsoNormal" style=""><br></p><p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">// Create rounded
lat lon table</span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">Select</span><span style="font-size:10.0pt;font-family:"Courier New";"> <span style="color:fuchsia;">count</span><span style="color:gray;">(*),</span> <span style="color:fuchsia;">round</span><span style="color:gray;">(</span><span style="color:fuchsia;">cast</span><span style="color:gray;">(</span>ST_X<span style="color:gray;">(</span>geom<span style="color:gray;">)</span> <span style="color:blue;">as</span> <span style="color:blue;">numeric</span><span style="color:gray;">),</span>2<span style="color:gray;">)</span> <span style="color:blue;">as</span> lon<span style="color:gray;">,</span> </span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:fuchsia;">round</span><span style="font-size:10.0pt;font-family:"Courier New";color:gray;">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:fuchsia;">cast</span><span style="font-size:10.0pt;font-family:"Courier New";color:gray;">(</span><span style="font-size:10.0pt;font-family:"Courier New";">ST_Y<span style="color:gray;">(</span>geom<span style="color:gray;">)</span> <span style="color:blue;">as</span> <span style="color:blue;">numeric</span><span style="color:gray;">),</span>2<span style="color:gray;">)</span> <span style="color:blue;">as</span> lat</span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">Into</span><span style="font-size:10.0pt;font-family:"Courier New";">
business_rd2</span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">From</span><span style="font-size:10.0pt;font-family:"Courier New";">
business_loc</span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">Group</span><span style="font-size:10.0pt;font-family:"Courier New";"> <span style="color:blue;">By</span> <span style="color:fuchsia;">round</span><span style="color:gray;">(</span><span style="color:fuchsia;">cast</span><span style="color:gray;">(</span>ST_X<span style="color:gray;">(</span>geom<span style="color:gray;">)</span> <span style="color:blue;">as</span> <span style="color:blue;">numeric</span><span style="color:gray;">),</span>2<span style="color:gray;">),</span> <span style="color:fuchsia;">round</span><span style="color:gray;">(</span><span style="color:fuchsia;">cast</span><span style="color:gray;">(</span>ST_Y<span style="color:gray;">(</span>geom<span style="color:gray;">)</span> <span style="color:blue;">as</span> <span style="color:blue;">numeric</span><span style="color:gray;">),</span>2<span style="color:gray;">)</span></span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">Order</span><span style="font-size:10.0pt;font-family:"Courier New";"> <span style="color:blue;">By</span> <span style="color:fuchsia;">count</span> <span style="color:blue;">Desc</span></span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;"> </span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">// Add Geometry</span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">Alter</span><span style="font-size:10.0pt;font-family:"Courier New";"> <span style="color:blue;">Table</span> business_rd2 <span style="color:blue;">Add</span>
<span style="color:blue;">Column</span> geom <span style="color:blue;">geometry</span><span style="color:gray;">(</span>POINT<span style="color:gray;">,</span>4326<span style="color:gray;">);</span></span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">Update</span><span style="font-size:10.0pt;font-family:"Courier New";">
business_rd2 <span style="color:blue;">Set</span> geom <span style="color:gray;">=</span>
ST_SetSRID<span style="color:gray;">(</span>ST_MakePoint<span style="color:gray;">(</span>lon<span style="color:gray;">,</span>lat<span style="color:gray;">),</span>4326<span style="color:gray;">);</span></span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">Create</span><span style="font-size:10.0pt;font-family:"Courier New";"> <span style="color:blue;">Index</span> indx_business_rd2_geom <span style="color:blue;">On</span>
business_rd2 <span style="color:blue;">Using</span> GIST<span style="color:gray;">(</span>geom<span style="color:gray;">);</span></span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;"> </span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;font-family:"Courier New";color:blue;">// Now add a
primary key named id to enable mapserver drawing</span></p>
<p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;line-height:115%;font-family:"Courier New";color:blue;">Alter</span><span style="font-size:10.0pt;line-height:115%;font-family:"Courier New";"> <span style="color:blue;">Table</span>
business_rd2 <span style="color:blue;">Add</span> <span style="color:blue;">Column</span>
id BIGSERIAL <span style="color:blue;">Primary</span> <span style="color:blue;">Key</span><span style="color:gray;">;</span></span></p><p class="ecxMsoNormal" style=""><span style="font-size:10.0pt;line-height:115%;font-family:"Courier New";"><span style="color:gray;"><br></span></span></p><br><div>> Date: Fri, 9 Aug 2013 12:23:52 +0200<br>> Subject: Re: [mapserver-users] drawing multiple layers from postgis<br>> From: thomas.bonfort@gmail.com<br>> To: mmcinnis59@msn.com<br>> <br>> On 8 August 2013 20:16, Michael McInnis <mmcinnis59@msn.com> wrote:<br>> > Hopefully, this is an easy one.<br>> ><br>> > I'm trying to build a scale sensitive .map file using points from postgis.<br>> ><br>> > I can successfully draw the shapefile states with a single points layer from<br>> > postgis.<br>> > However, if I add an additional points layer and attempt to draw it the<br>> > layer comes up blank.<br>> > If I remove the leading postgis points layer from the .map file the new<br>> > points layer will now display.<br>> > IE I can only draw the first occurrence of a postgis layer in the map file.<br>> ><br>> > How do you define multiple postgis layers so that you can pick and choose<br>> > layers for display?<br>> ><br>> > LAYER<br>> > NAME states<br>> > DATA STATES<br>> > STATUS ON<br>> > TYPE Polygon<br>> ><br>> > CLASS<br>> > OUTLINECOLOR 255 255 255<br>> > COLOR 155 155 155<br>> > END # Class<br>> > END # Layer<br>> ><br>> > LAYER<br>> > CONNECTIONTYPE POSTGIS<br>> > NAME business_rd2<br>> > CONNECTION "host=localhost dbname=Business user=postgres<br>> > password=xxxx port=5432"<br>> > PROCESSING "CLOSE_CONNECTION=DEFER"<br>> > DATA "geom From business_rd2 as rd2 using unique id using srid=4326"<br>> > #MINSCALE 100000<br>> > STATUS ON<br>> > TYPE POINT<br>> > CLASS<br>> > SYMBOL 'circle'<br>> > SIZE 2<br>> > COLOR 255 0 0<br>> > END<br>> this END is bogus<br>> <br>> > END # Class<br>> > END # Layer<br>> ><br>> > LAYER<br>> > CONNECTIONTYPE POSTGIS<br>> > NAME business_rd1<br>> > CONNECTION "host=localhost dbname=Business user=postgres<br>> > password=xxxx port=5432"<br>> > PROCESSING "CLOSE_CONNECTION=DEFER"<br>> > DATA "geom From business_rd1 as rd1 using unique id using srid=4326"<br>> > #MINSCALE 100000<br>> > STATUS ON<br>> > TYPE POINT<br>> > CLASS<br>> > SYMBOL 'circle'<br>> > SIZE 2<br>> > COLOR 255 0 0<br>> > END<br>> this one to<br>> <br>> > END # Class<br>> > END # Layer<br>> ><br>> ><br>> > _______________________________________________<br>> > mapserver-users mailing list<br>> > mapserver-users@lists.osgeo.org<br>> > http://lists.osgeo.org/mailman/listinfo/mapserver-users<br>> ><br></div></div> </div></div> </div></body>
</html>