<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Bob,<br><br><br>I suggest you try testing with QGIS.<br><br>Easy to open the native postgis table & a mapserver WFS/WMS layer concurrently to ensure it is all working as it should.<br><br>Also ensure you have configured your Postgis (Postgres) database to allow applications such as mapserver to connect. For testing purposes, set access to the database to trusted for all in pb_hba.conf, & enable external connections in postgresql.conf, then restart the server to ensure the changes are activated.<br><br>You can also enable mapserver debugging & specify a log file to see what error is reported.<br><a href="http://mapserver.org/optimization/debugging.html">http://mapserver.org/optimization/debugging.html</a><br><br>You may also need to specify the unique ID column name & the SRID you are using in your DATA string, much like this one:<br>DATA
"track_line from (select * from trip_track where trip_code = 'ind0701') as foo using unique id using srid 4326"<br><br>HTH,<br><br> Brent Wood<br><br>--- On <b>Tue, 2/14/12, Bistrais, Bob <i><Bob.Bistrais@maine.gov></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Bistrais, Bob <Bob.Bistrais@maine.gov><br>Subject: [mapserver-users] Trouble connecting to PostGIS<br>To: mapserver-users@lists.osgeo.org<br>Date: Tuesday, February 14, 2012, 10:11 AM<br><br><div id="yiv902123819">
<style>
<!--
#yiv902123819
#yiv902123819 p.yiv902123819MsoNormal, #yiv902123819 li.yiv902123819MsoNormal, #yiv902123819 div.yiv902123819MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}
#yiv902123819 a:link, #yiv902123819 span.yiv902123819MsoHyperlink
{color:blue;text-decoration:underline;}
#yiv902123819 a:visited, #yiv902123819 span.yiv902123819MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
#yiv902123819 span.yiv902123819EmailStyle17
{font-family:Arial;color:windowtext;}
_filtered #yiv902123819 {margin:1.0in 1.25in 1.0in 1.25in;}
#yiv902123819 div.yiv902123819Section1
{}
-->
</style>
<div>
<div class="yiv902123819Section1">
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">First of all, let me state that I am brand new to PostGIS
and don’t know much about what I’m doing with it. That being said,
I am having trouble displaying a PostGIS layer through MapServer.</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;"> </span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">Right now I’m just experimenting with PostGIS and
simply trying to get a layer to display. I installed the Postgre and PostGIS
1.5. I used the shapefile loader to convert a couple shapefiles to PostGIS
data. Looking in pgAdmin, I see the tables do indeed exist for these layers.</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;"> </span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">So I built a MapServer map file. Here is my connection
strings:</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;"> </span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">DATA "the_geom from MylayerPoly"</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">CONNECTION "user=postgisuser password=MyPassword!
dbname=postgistest host=localhost port=5432"</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">CONNECTIONTYPE postgis</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;"> </span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">But the layer does not display. Incidentally, I’m
using GeoMoose as a front end for testing, but that shouldn’t matter
here.</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;"> </span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">I did a mapserv –v at commandline, and I see the
parameter INPUT=POSTGIS.</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;"> </span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">So as far as I know it should work. Can anyone offer
suggestions as to what I’m doing wrong?</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;"> </span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">Thanks,</span></font></p>
<p class="yiv902123819MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;font-family:Arial;">Bob</span></font></p>
</div>
</div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>mapserver-users mailing list<br><a ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div></blockquote></td></tr></table>