<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'>Nice work Thomas! That's got it.<div><br></div><div><a href="http://mapserver0/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business.map&layers=business_rd4%20states&mode=map" target="_blank">http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/business.map&layers=business_rd4%20states&mode=map</a><br><br>Now I can call any of the 4 from one .map file.</div><div><br></div><div>Now I just need to figure out how to call a specific layer via a .php file.</div><div><br></div><div>Thanks a lot, very subtle change there Adding STYLE in front of SYMBOL.<br><br>Michael McInnis
6033 44th Ave. N.E.
Seattle, WA 98115
206 517-4701<br><br><div>> From: bob.basques@ci.stpaul.mn.us<br>> CC: mapserver-users@lists.osgeo.org<br>> Date: Fri, 9 Aug 2013 16:02:31 +0000<br>> Subject: Re: [mapserver-users] drawing multiple layers from postgis<br>> <br>> Thomas,<br>> <br>> Oh man!!  That's a subtle piece of info, any reason the END can't be left in there as a default somehow or at least ignored inside of the STYLE block, I can see this coming back to bite folks over time with the two different formats for SYMBOL/(and sometime END) combos.<br>> <br>> <br>> <br>> Bobb<br>> <br>> <br>> <br>> -----Original Message-----<br>> From: mapserver-users-bounces@lists.osgeo.org [mailto:mapserver-users-bounces@lists.osgeo.org] On Behalf Of thomas bonfort<br>> Sent: Friday, August 09, 2013 10:58 AM<br>> To: Michael McInnis<br>> Cc: mapserver-users@lists.osgeo.org<br>> Subject: Re: [mapserver-users] drawing multiple layers from postgis<br>> <br>> third time's a charm :)<br>> <br>> LAYER<br>>         NAME business_rd1<br>>         CONNECTIONTYPE POSTGIS<br>>         CONNECTION "host=localhost dbname=Business user=postgres password=xxxx port=5432"<br>>         DATA "geom From business_rd1 as rd1 using unique id using srid=4326"<br>>         PROCESSING "CLOSE_CONNECTION=DEFER"<br>>         #MINSCALE 10000000<br>> STATUS ON<br>>         TYPE POINT<br>>         CLASS<br>>            STYLE<br>>               SYMBOL 'circle'<br>>               SIZE 2<br>>               COLOR 255 0 0<br>>            END #Style<br>>         END # Class<br>>     END # Layer<br>> <br>> symbol takes an END when you're defining a symbol , not when referencing it in a style.<br>> <br>> On 9 August 2013 17:55, Michael McInnis <mmcinnis59@msn.com> wrote:<br>> > Thomas,<br>> ><br>> > Here is my complete map file when all the postgis layers are combined. <br>> > Like I said, I can call all of these layers if I put just one layer in <br>> > a .map file but can't get it to work with more than one.<br>> ><br>> > Thanks!<br>> ><br>> > MAP<br>> >     DEBUG 5<br>> >     CONFIG "MS_ERRORFILE" "/media/D_Drive/www/gis/logs/error_file.log"<br>> >     EXTENT -126 25 -64 50<br>> >     #EXTENT -123 47 -122 48<br>> >     IMAGECOLOR 153 179 204<br>> >     IMAGETYPE PNG24<br>> >     SHAPEPATH data/<br>> >     FONTSET data/fonts/fonts.list<br>> >     SIZE 1000 500<br>> >     #SIZE 800 800<br>> >     #SCALEDENOM 50000<br>> >     UNITS DD<br>> >     PROJECTION<br>> > "+proj=longlat +ellps=WGS84"<br>> >     END<br>> >     OUTPUTFORMAT<br>> > NAME png<br>> > DRIVER "AGG/PNG"<br>> > MIMETYPE "image/png"<br>> > IMAGEMODE RGBA<br>> > EXTENSION "png"<br>> >     END<br>> >     WEB<br>> > IMAGEPATH "/media/D_Drive/www/gis/tmp/"<br>> > IMAGEURL "gis/tmp/"<br>> >     END<br>> ><br>> >     SYMBOL<br>> >         NAME "circle"<br>> >         TYPE ELLIPSE<br>> >         FILLED TRUE<br>> >         POINTS 1 1 END<br>> >     END<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>> >         NAME business_rd1<br>> >         CONNECTIONTYPE POSTGIS<br>> >         CONNECTION "host=localhost dbname=Business user=postgres <br>> > password=xxxx port=5432"<br>> >         DATA "geom From business_rd1 as rd1 using unique id using srid=4326"<br>> >         PROCESSING "CLOSE_CONNECTION=DEFER"<br>> >         #MINSCALE 10000000<br>> > STATUS ON<br>> >         TYPE POINT<br>> >         CLASS<br>> >             SYMBOL 'circle'<br>> >                 SIZE 2<br>> >                 COLOR 255 0 0<br>> >             END<br>> >         END # Class<br>> >     END # Layer<br>> ><br>> >     LAYER<br>> >         NAME business_rd2<br>> >         CONNECTIONTYPE POSTGIS<br>> >         CONNECTION "host=localhost dbname=Business user=postgres <br>> > password=xxxxx port=5432"<br>> >         DATA "geom From business_rd2 as rd2 using unique id using srid=4326"<br>> >         PROCESSING "CLOSE_CONNECTION=DEFER"<br>> >         #MINSCALE 1000000<br>> > STATUS ON<br>> >         TYPE POINT<br>> >         CLASS<br>> >             SYMBOL 'circle'<br>> >                 SIZE 2<br>> >                 COLOR 0 255 0<br>> >             END<br>> >         END # Class<br>> >     END # Layer<br>> ><br>> >     LAYER<br>> >         NAME business_rd3<br>> >         CONNECTIONTYPE POSTGIS<br>> >         CONNECTION "host=localhost dbname=Business user=postgres <br>> > password=xxxx port=5432"<br>> >         DATA "geom From business_rd3 as rd3 using unique id using srid=4326"<br>> >         PROCESSING "CLOSE_CONNECTION=DEFER"<br>> >         #MINSCALE 100000<br>> > STATUS ON<br>> >         TYPE POINT<br>> >         CLASS<br>> >             SYMBOL 'circle'<br>> >                 SIZE 2<br>> >                 COLOR 0 0 255<br>> >             END<br>> >         END # Class<br>> >     END # Layer<br>> ><br>> >     LAYER<br>> >         NAME business_rd4<br>> >         CONNECTIONTYPE POSTGIS<br>> >         CONNECTION "host=localhost dbname=Business user=postgres <br>> > password=xxxxx port=5432"<br>> >         DATA "geom From business_rd4 as rd4 using unique id using srid=4326"<br>> >         PROCESSING "CLOSE_CONNECTION=DEFER"<br>> >         #MINSCALE 10000<br>> > STATUS ON<br>> >         TYPE POINT<br>> >         CLASS<br>> >             SYMBOL 'circle'<br>> >                 SIZE 2<br>> >                 COLOR 255 0 255<br>> >             END<br>> >         END # Class<br>> >     END # Layer<br>> > END # Map File<br>> ><br>> ><br>> > Michael McInnis 6033 44th Ave. N.E. Seattle, WA 98115 206 517-4701<br>> ><br>> >> Date: Fri, 9 Aug 2013 17:44:02 +0200<br>> ><br>> >> Subject: Re: [mapserver-users] drawing multiple layers from postgis<br>> >> From: thomas.bonfort@gmail.com<br>> >> To: mmcinnis59@msn.com<br>> >> CC: mapserver-users@lists.osgeo.org<br>> ><br>> >><br>> >> https://github.com/mapserver/mapserver/issues/2922<br>> >><br>> >> On 9 August 2013 17:40, Michael McInnis <mmcinnis59@msn.com> wrote:<br>> >> ><br>> >> > I'm pretty sure that END is correctly ending the Symbol Clause.<br>> >> ><br>> >> > The odd thing about this is I can draw all four layers if I call <br>> >> > them separately but when I try to call them through php only <br>> >> > numbers 1 and 3 work. All layers were generated the same way in <br>> >> > postgresql/postgis (see sql below).<br>> >> ><br>> >> > I'm going to regenerate layers 2 and 4 just in case but I think <br>> >> > it's a problem with php/ms_script.<br>> >> ><br>> >> > // All these work<br>> >> ><br>> >> ><br>> >> > http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/busines<br>> >> > s1.map&layers=business_rd1%20states&mode=map<br>> >> ><br>> >> ><br>> >> > http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/busines<br>> >> > s2.map&layers=business_rd2%20states&mode=map<br>> >> ><br>> >> ><br>> >> > http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/busines<br>> >> > s3.map&layers=business_rd3%20states&mode=map<br>> >> ><br>> >> ><br>> >> > http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/busines<br>> >> > s4.map&layers=business_rd4%20states&mode=map<br>> >> ><br>> >> ><br>> >> ><br>> >> > // Half of these work<br>> >> ><br>> >> > http://mapserver0/business.php?num=1 works<br>> >> ><br>> >> > http://mapserver0/business.php?num=2 not<br>> >> ><br>> >> > http://mapserver0/business.php?num=3 works<br>> >> ><br>> >> > http://mapserver0/business.php?num=4 not<br>> >> ><br>> >> ><br>> >> ><br>> >> > // All these work<br>> >> ><br>> >> ><br>> >> > http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/busines<br>> >> > s1.map&layers=business_rd1%20states&mode=map<br>> >> ><br>> >> ><br>> >> > http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/busines<br>> >> > s2.map&layers=business_rd2%20states&mode=map<br>> >> ><br>> >> ><br>> >> > http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/busines<br>> >> > s3.map&layers=business_rd3%20states&mode=map<br>> >> ><br>> >> ><br>> >> > http://localhost/cgi-bin/mapserv?map=/media/D_Drive/www/gis/busines<br>> >> > s4.map&layers=business_rd4%20states&mode=map<br>> >> ><br>> >> ><br>> >> ><br>> >> > // Half of these work<br>> >> ><br>> >> > http://mapserver0/business.php?num=1 works<br>> >> ><br>> >> > http://mapserver0/business.php?num=2 not<br>> >> ><br>> >> > http://mapserver0/business.php?num=3 works<br>> >> ><br>> >> > http://mapserver0/business.php?num=4 not<br>> >> ><br>> >> ><br>> >> > // Create rounded lat lon table<br>> >> ><br>> >> > Select count(*), round(cast(ST_X(geom) as numeric),2) as lon,<br>> >> ><br>> >> > round(cast(ST_Y(geom) as numeric),2) as lat<br>> >> ><br>> >> > Into business_rd2<br>> >> ><br>> >> > From business_loc<br>> >> ><br>> >> > Group By round(cast(ST_X(geom) as numeric),2), <br>> >> > round(cast(ST_Y(geom) as<br>> >> > numeric),2)<br>> >> ><br>> >> > Order By count Desc<br>> >> ><br>> >> ><br>> >> ><br>> >> > // Add Geometry<br>> >> ><br>> >> > Alter Table business_rd2 Add Column geom geometry(POINT,4326);<br>> >> ><br>> >> > Update business_rd2 Set geom = <br>> >> > ST_SetSRID(ST_MakePoint(lon,lat),4326);<br>> >> ><br>> >> > Create Index indx_business_rd2_geom On business_rd2 Using <br>> >> > GIST(geom);<br>> >> ><br>> >> ><br>> >> ><br>> >> > // Now add a primary key named id to enable mapserver drawing<br>> >> ><br>> >> > Alter Table business_rd2 Add Column id BIGSERIAL Primary Key;<br>> >> ><br>> >> ><br>> >> ><br>> >> >> Date: Fri, 9 Aug 2013 12:23:52 +0200<br>> >> >> Subject: Re: [mapserver-users] drawing multiple layers from <br>> >> >> 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 <br>> >> >> > from postgis.<br>> >> >> ><br>> >> >> > I can successfully draw the shapefile states with a single <br>> >> >> > points layer from postgis.<br>> >> >> > However, if I add an additional points layer and attempt to draw <br>> >> >> > it the layer comes up blank.<br>> >> >> > If I remove the leading postgis points layer from the .map file <br>> >> >> > the new points layer will now display.<br>> >> >> > IE I can only draw the first occurrence of a postgis layer in <br>> >> >> > the map file.<br>> >> >> ><br>> >> >> > How do you define multiple postgis layers so that you can pick <br>> >> >> > and choose 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>> >> ><br>> >> > _______________________________________________<br>> >> > mapserver-users mailing list<br>> >> > mapserver-users@lists.osgeo.org<br>> >> > http://lists.osgeo.org/mailman/listinfo/mapserver-users<br>> >> ><br>> _______________________________________________<br>> mapserver-users mailing list<br>> mapserver-users@lists.osgeo.org<br>> http://lists.osgeo.org/mailman/listinfo/mapserver-users<br>> <br>> <br>> _______________________________________________<br>> mapserver-users mailing list<br>> mapserver-users@lists.osgeo.org<br>> http://lists.osgeo.org/mailman/listinfo/mapserver-users<br></div></div>                                        </div></body>
</html>