Hi fellows,<br><br>thank you for your assistance with the Mapserver issue I&#39;ve had. I compiled the mapserver 6.1-dev from the SVN respository and it worked! :)<br><br>Kind regards<br>Cheryl<br><br><br><br>#######<br>Hi,<br>
<br>I&#39;m trying to get Mapserver connected with PostGIS. PostGIS is holding<br>
a shape2pgsql contourline import in the table &quot;atest&quot; while a test has<br>the following columns (shape2pgsql default):<br>
<br>--------------------------------------<br>| Actions | gid | id | height | geom |<br>--------------------------------------<br><br>Quantum GIS picks the conection up perfectly to atest but with<br>Mapserver I just get a blank screen - or the color of IMAGECOLOR [. .<br>


.] definition in *.map definitions.<br><br>Somehow it seems like I got the connection between Mapserver and<br>PostGIS running - at least the debug.log doesn&#39;t complain. But still<br>I&#39;m not seeing any of my contour lines as I&#39;m used to by Quantum GIS<br>


;(<br><br>Could someone give me a hint of what I&#39;m missing out or where my mistake is?<br>I got the feeling that it is either has something to do with the DATA<br>property or the projection properties …<br><br>The Link with which I call the mapserv binary is:<br>


<br><a href="http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&amp;mode=map" target="_blank">http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&amp;mode=map</a><br>But then it complains:<br>msDrawMap(): Image handling error. Unable to initialize image.<br>


msPrepareImage(): General error message. Image dimensions not<br>specified. msCalculateScale(): General error message. Invalid image<br>width or height.<br><br>So I changed it to the following:<br><a href="http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&amp;mode=map&amp;mapsize=600+800" target="_blank">http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&amp;mode=map&amp;mapsize=600+800</a><br>


which results in fortunately no errors but therefore in a blank screen<br>with a clean debug.log ...<br><br>Even this one wont change anything:<br><a href="http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&amp;mode=map&amp;mapsize=600+800&amp;layer=Contour" target="_blank">http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&amp;mode=map&amp;mapsize=600+800&amp;layer=Contour</a><br>


<br>I attached some screenshots for clearity . . .<br>. . . my test-2.map definition is attached below:<br><br>P.S.: TEMPLATE &quot;./Maps/test.map&quot; does exist and is read and writeable<br>to the user which runs the webserver (Apache =&gt; User: www)<br>


CONFIG &quot;PROJ_LIB&quot; &quot;/usr/local/share/proj/&quot; should also be valid:<br><br>FreeBSD [~]# ls /usr/local/share/proj<br>FL                      WO                      hawaii                  null                    stlrnc<br>


GL27                    alaska                  nad.lst                 nzgd2kgrid0005.gsb      stpaul<br>IGNF                    conus                   nad27                   other.extra             world<br>MD                      epsg                    nad83                   proj_def.dat<br>


TN                      esri                    ntf_r93.gsb             prvi<br>WI                      esri.extra              ntv1_can.dat            stgeorge<br><br><br><br># =================================== test-2.map<br>


=================================== #<br><br><br>MAP<br><br>   CONFIG &quot;PROJ_LIB&quot; &quot;/usr/local/share/proj/&quot;<br>   CONFIG &quot;MS_ERRORFILE&quot; &quot;./debug.log&quot;<br>   DEBUG 5<br><br>   IMAGECOLOR 100 100 100<br>


<br>   NAME      &quot;Contour&quot;<br>   EXTENT    -<a href="tel:90%20-180%2090%20180" value="+19018090180" target="_blank">90 -180 90 180</a><br>   STATUS    ON<br><br>   PROJECTION<br>       &quot;init=epsg:4326&quot;<br>

   END<br><br>   WEB<br>       METADATA<br>           WMS_NAME                         &quot;Contour&quot;<br>
           WMS_TITLE                        &quot;SRTM - ContourLines&quot;<br>           WMS_ABSTRACT                     &quot;My First Web Map Server&quot;<br>           WMS_SERVER_VERSION               &quot;1.1.1&quot;<br>


           WMS_SRS                          &quot;EPSG:4326&quot;<br>           WMS_ONLINERESOURCE<br>&quot;<a href="http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map" target="_blank">http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map</a>&quot;<br>


           WMS_ATTRIBUTION_TITLE            &quot;Some Attribute Title&quot;<br>           WMS_ATTRIBUTION_ONLINERESOURCE   &quot;<a href="http://www.myHomepage.com/" target="_blank">http://www.myHomepage.com/</a>&quot;<br>

           WMS_KEYWORDLIST<br>
&quot;DEM,SRTM,Contourlines,Contour,Lines,Digital,Area,Model&quot;<br>           WMS_FEATURE_INFO_MIME_TYPE       &quot;text/html&quot;<br>           WMS_CONTACTELECTRONICMAILADDRESS &quot;User@Domain.tld&quot;<br>           WMS_CONTACTPERSON                &quot;Some Reference Person&quot;<br>


           WMS_CONTACTVOICETELEPHONE        &quot;+49-phoneNumber&quot;<br>           WMS_CONTACTORGANIZATION          &quot;Private&quot;<br>           WMS_ENCODING                     &quot;utf-8&quot;<br>       END<br>


   END<br><br><br>   LAYER # query layer from PostgreSQL table<br>           NAME          &quot;Contour&quot;<br>           EXTENT        143 -20 145 -19<br>           TYPE          LINE<br>           STATUS        ON<br>


           DEBUG         ON<br>           TEMPLATE      &quot;./Maps/test.map&quot;<br>           DUMP          true<br>           METADATA<br>               WMS_NAME          &quot;Contour&quot;<br>               WMS_TITLE         &quot;Contour Lines - 90m&quot;<br>


               WMS_ABSTRACT      &quot;Contour Lines - 90m&quot;<br>               WMS_SRS           &quot;EPSG:4326&quot;<br>               GML_INCLUDE_ITEMS &quot;all&quot;<br>           END<br><br>           CONNECTIONTYPE POSTGIS<br>


           CONNECTION    &quot;host=192.168.10.15 port=5432<br>dbname=my_spatial_db user=admin password=******&quot;<br>           DATA          &quot;geom FROM atest using unique gid using srid=4326&quot;<br><br>           CLASS<br>


               STYLE<br>                   COLOR 000 000 000<br>                   OUTLINECOLOR 199 199 199<br>           END<br>       END<br><br>   END<br>END<br><br><br># ==================================================================================<br>


#<br><br><br><br><br><br><br><br><br># =================================== debug.log<br>=================================== #<br><br>FreeBSD [/usr/local/www/cgi-bin/Maps]# cat ./debug.log<br><br>[Sat Feb 11 19:02:01 2012].3032 CGI Request 1 on process 2663<br>


[Sat Feb 11 19:02:01 2012].10325 msDrawMap(): rendering using<br>outputformat named png (AGG/PNG).<br>[Sat Feb 11 19:02:01 2012].10365 msDrawMap(): WMS/WFS set-up and query, 0.000s<br>[Sat Feb 11 19:02:01 2012].10388 msDrawMap(): Drawing Label Cache, 0.000s<br>


[Sat Feb 11 19:02:01 2012].10398 msDrawMap() total time: 0.007s<br>[Sat Feb 11 19:02:01 2012].76893 msSaveImage(stdout) total time: 0.066s<br>[Sat Feb 11 19:02:01 2012].77721 mapserv request processing time<br>(loadmap not incl.): 0.075s<br>


[Sat Feb 11 19:02:01 2012].77749 msFreeMap(): freeing map at 0x29879800.<br>[Sat Feb 11 19:02:01 2012].77839 msPostGISLayerIsOpen called.<br><br># ==================================================================================<br>


#<br>#############<br><br>Cherly,<br><br> One issue could be that you&#39;ve asked Mapserver to render the entire world:<br><br><br>EXTENT    -<a href="tel:90%20-180%2090%20180" value="+19018090180" target="_blank">90 -180 90 180</a><br>

<br>into a small image:<br><br>mapsize=600+800<br><br>Adjust the extents of the output image to be the extent of you contour data.  I see that you&#39;ve given that in your LAYER definition<br>
<br><br>           EXTENT        143 -20 145 -19<br><br>so try that for the map extent (but I think it would be valid only if the contours were stored in a Geographic system and not a Projected system).  What SRS are you storing your data in?  The same as your display (EPSG:4326)?<br>


<br>Best Regards,<br>Brent Fraser<br><br><br>################<br><br>Hi Brent,<br><br>Thanks for your reply.<br><br>The SRS my data is stored in WGS84.<br><br>Unfortunately, I am not getting configuration file right. I adjusted the map EXTENT to something smaller,<br>


<br>Map<br><br>Extent 16 -28 25 -16<br> <br><br>The layer extent I also adjusted to the output image of the contour data,<br><br>Layer<br><br>Extent 17.002 -20.965 18.007 -20.002<br><br>I played around with the figures a little but I get this error message at all times,<br>


<br>&quot;msDrawMap(): Image handling error. Failed to draw layer named &#39;Contour&#39;. msPostGISLayerWhichShapes(): Query error. Error (ERROR: function geomfromtext(unknown, integer) does not exist LINE 1: ...R&#39;),&#39;hex&#39;) as geom,&quot;gid&quot; from atest where geom &amp;&amp; GeomFromTe... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. ) executing query: select encode(ST_AsBinary(ST_Force_2D(&quot;geom&quot;),&#39;NDR&#39;),&#39;hex&#39;) as geom,&quot;gid&quot; from atest where geom &amp;&amp; GeomFromText(&#39;POLYGON((15.8348164627364 -28,15.8348164627364 -16,25.1651835372636 -16,25.1651835372636 -28,15.8348164627364 -28))&#39;,4326)&quot;<br>


<br>Since this is my first time configurating a mapfile, I am unsure of what is essential and what not, thus, I copied and pasted the script and adjusted it to my CONNECTION details. I am not too sure whether it is vital to have both a &quot;map extent&quot; and a &quot;layer extend&quot;?<br>


<br>Do you perhaps have any hints in this regard?<br><br>Best Regards<br>Cheryl  <br><br><br>###############<br><br>Yikes!   That looks like a compatibility problem.  PostGIS has been changing their function names (e.g. from &quot;GeomFromText&quot; to &quot;ST_GeomFromText&quot;), and I don&#39;t  think Mapserver has kept up.  Can you use an older version of PostGIS (&lt;2.0)?<br>


<br><a href="http://postgis.refractions.net/pipermail/postgis-devel/2012-January/017272.html" target="_blank">http://postgis.refractions.net/pipermail/postgis-devel/2012-January/017272.html</a><br><br>############<br><br>

<br>Opened a ticket for this problem:<br>
<br><a href="http://trac.osgeo.org/mapserver/ticket/4186" target="_blank">http://trac.osgeo.org/mapserver/ticket/4186</a><br><br>Add yourselves to the CC list if you want to track it.<br><br>-Steve W<br><br>##########<br>

<br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>