<html><head><base href="x-msg://60/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Vishal,</div><div><br></div><div>David has probably nailed this one, but if not or otherwise you might also want to put DEBUG ON into your map and the LAYER definitions (you need both) - the debug output from postgis connections is comprehensive if a little complex initially, but very useful for learning.</div><div><br></div><div>It doesn't hurt to explicitly set projections as well, to make sure they match.</div><div><br></div><div>cheers</div><div><br></div><div>Ben</div><div><br><div><br></div><div><br><div><div>On 18/08/2011, at 4:09 AM, Vishal Mehta wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Hi all,<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I am testing out mapserver-postgis and a simple test is returning an empty map. Here is my map file<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">MAP<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> IMAGETYPE PNG<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> EXTENT 77.5 12.95 77.7 13.01<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> SIZE 550 450<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> IMAGECOLOR 255 255 255<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> SHAPEPATH "../data"<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> # Start of LAYER DEFINITIONS-------------------------------<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> LAYER<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> CONNECTIONTYPE POSTGIS<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> NAME "wards"<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> # Connect to a remote spatial database<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> CONNECTION "host=localhost port=5432 dbname=empty user=postgres password=xxx"<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> # Get the lines from the 'geom' column of the 'wards' table<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> DATA 'geom from "myschema.wards198" using srid=4326 using unique gid'<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> STATUS ON<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> TYPE POLYGON<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><o:p> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> CLASS<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> NAME "wards" <o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> STYLE<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> OUTLINECOLOR 255 0 0<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> END<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> END<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> END<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> <o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> # End of LAYER DEFINITIONS -------------------------------<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">END<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">-------------------<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">And the html that calls it<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">--------------<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><html><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><head><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><title>my postgis map</title><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "></head><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><body bgcolor=white><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><center><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><br><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><table width=570><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><tr><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> <td><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> <br><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> <img width=550 height=450<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> src=/cgi-bin/mapserv.exe?map=C:\OSGeo4W/apps/mapserver-tutorial/mytests/example.map&mode=map<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> border=1><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "> </td><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "></tr><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "></table><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "><br><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "></body><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 1in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; "></html><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">----------------------------------------------------<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Other info:<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Platform:<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0.5in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in; "><span>-<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span>Windows 7, postgresql9 , postgis 2.0<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0.5in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in; "><span>-<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span>I installed Mapserver separately through the OSGEO4 installer.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0.5in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in; "><span>-<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span>I can connect to the same database through php<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0.5in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in; "><span>-<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span>I can create simple mapserver apps using shapefiles etc alright (e.g. same map file above, calling a shapefile, works fine)<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0.5in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in; "><span>-<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span>Mapserv.exe –v shows that it was installed with postgis support.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0.5in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in; "><span>-<span style="font: normal normal normal 7pt/normal 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span>Also can Mapserver handle postgis Mulipolygon geometry ok?<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I did check most of the points here which seemed ok ( i did not check those in this list that I don’t really know how to in Windows ).<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><a href="http://trac.osgeo.org/mapserver/wiki/PostGIS" style="color: blue; text-decoration: underline; ">http://trac.osgeo.org/mapserver/wiki/PostGIS</a><o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I realize this might be a mapserver mailing list qn, but thought that some of you might know the answer…it might be a simple syntax problem that I’ve missed…<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Thanks,<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Vishal<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><i><o:p> </o:p></i></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net" style="color: blue; text-decoration: underline; ">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" style="color: blue; text-decoration: underline; ">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></div></span></blockquote></div><br></div></div></body></html>