<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Yikes! That looks like a compatibility problem. PostGIS has been
changing their function names (e.g. from "GeomFromText" to
"ST_GeomFromText"), and I don't think Mapserver has kept up. Can
you use an older version of PostGIS (<2.0)?<br>
<br>
<a
href="http://postgis.refractions.net/pipermail/postgis-devel/2012-January/017272.html">http://postgis.refractions.net/pipermail/postgis-devel/2012-January/017272.html</a><br>
<br>
<pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
<br>
On 2/12/2012 3:06 PM, cheryl buckley wrote:
<blockquote
cite="mid:CAB71Fua5yPXM+zs_9+n1jYUCKbzvQsdF9FHh3Z+gbtirvi4Ewg@mail.gmail.com"
type="cite">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>
"msDrawMap(): Image handling error. Failed to draw layer named
'Contour'. msPostGISLayerWhichShapes(): Query error. Error (ERROR:
function geomfromtext(unknown, integer) does not exist LINE 1:
...R'),'hex') as geom,"gid" from atest where geom &&
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("geom"),'NDR'),'hex') as geom,"gid"
from atest where geom &&
GeomFromText('POLYGON((15.8348164627364 -28,15.8348164627364
-16,25.1651835372636 -16,25.1651835372636 -28,15.8348164627364
-28))',4326)"<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 "map extent" and a "layer
extend"?<br>
<br>
Do you perhaps have any hints in this regard?<br>
<br>
Best Regards<br>
Cheryl <br>
<br>
<br>
<br>
<div class="gmail_quote">
On Sun, Feb 12, 2012 at 6:49 PM, Brent Fraser <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:bfraser@geoanalytic.com">bfraser@geoanalytic.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Cherly,<br>
<br>
One issue could be that you've asked Mapserver to render the
entire world:
<div class="im"><br>
<br>
EXTENT -<a moz-do-not-send="true"
href="tel:90%20-180%2090%20180" value="+19018090180"
target="_blank">90 -180 90 180</a><br>
<br>
</div>
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've given that in your LAYER
definition
<div class="im"><br>
<br>
EXTENT 143 -20 145 -19<br>
<br>
</div>
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
<div>
<div class="h5"><br>
<br>
<br>
On 2/12/2012 9:43 AM, cheryl buckley wrote:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div class="h5">
Hi,<br>
<br>
I'm trying to get Mapserver connected with PostGIS.
PostGIS is holding<br>
a shape2pgsql contourline import in the table "atest"
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 test-2.map definitions.<br>
<br>
Somehow it seems like I got the connection between
Mapserver and<br>
PostGIS running - at least the debug.log doesn't
complain. But still<br>
I'm not seeing any of my contour lines as I'm used to by
Quantum GIS<br>
;(<br>
<br>
Could someone give me a hint of what I'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 moz-do-not-send="true"
href="http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&mode=map"
target="_blank">http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&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 moz-do-not-send="true"
href="http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&mode=map&mapsize=600+800"
target="_blank">http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&mode=map&mapsize=600+800</a><br>
which results in no errors but therefore in a blank
screen with a<br>
clean debug.log ...<br>
<br>
Even this one wont change anything:<br>
<a moz-do-not-send="true"
href="http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&mode=map&mapsize=600+800&layer=Contour"
target="_blank">http://192.168.10.15/cgi-bin/mapserv?map=./Maps/test.map&mode=map&mapsize=600+800&layer=Contour</a><br>
<br>
<br>
. . . my test-2.map definition is below:<br>
<br>
P.S.: TEMPLATE "./Maps/test.map" does exist and is read
and writeable<br>
to the user which runs the webserver (Apache =>
User: www)<br>
CONFIG "PROJ_LIB" "/usr/local/share/proj/" 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 "PROJ_LIB" "/usr/local/share/proj/"<br>
CONFIG "MS_ERRORFILE" "./debug.log"<br>
DEBUG 5<br>
<br>
IMAGECOLOR 100 100 100<br>
<br>
NAME "Contour"<br>
EXTENT -<a moz-do-not-send="true"
href="tel:90%20-180%2090%20180" value="+19018090180"
target="_blank">90 -180 90 180</a><br>
STATUS ON<br>
<br>
PROJECTION<br>
"init=epsg:4326"<br>
END<br>
<br>
WEB<br>
METADATA<br>
WMS_NAME "Contour"<br>
WMS_TITLE "SRTM -
ContourLines"<br>
WMS_ABSTRACT "My First
Web Map Server"<br>
WMS_SERVER_VERSION "1.1.1"<br>
WMS_SRS "EPSG:4326"<br>
WMS_ONLINERESOURCE<br>
"<a moz-do-not-send="true"
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>"<br>
WMS_ATTRIBUTION_TITLE "Some
Attribute Title"<br>
WMS_ATTRIBUTION_ONLINERESOURCE "<a
moz-do-not-send="true"
href="http://www.myHomepage.com/" target="_blank">http://www.myHomepage.com/</a>"<br>
WMS_KEYWORDLIST<br>
"DEM,SRTM,Contourlines,Contour,Lines,Digital,Area,Model"<br>
WMS_FEATURE_INFO_MIME_TYPE "text/html"<br>
WMS_CONTACTELECTRONICMAILADDRESS
<a class="moz-txt-link-rfc2396E" href="mailto:User@Domain.tld">"User@Domain.tld"</a><br>
WMS_CONTACTPERSON "Some
Reference Person"<br>
WMS_CONTACTVOICETELEPHONE
"+49-phoneNumber"<br>
WMS_CONTACTORGANIZATION "Private"<br>
WMS_ENCODING "utf-8"<br>
END<br>
END<br>
<br>
<br>
LAYER # query layer from PostgreSQL table<br>
NAME "Contour"<br>
EXTENT 143 -20 145 -19<br>
TYPE LINE<br>
STATUS ON<br>
DEBUG ON<br>
TEMPLATE "./Maps/test.map"<br>
DUMP true<br>
METADATA<br>
WMS_NAME "Contour"<br>
WMS_TITLE "Contour Lines - 90m"<br>
WMS_ABSTRACT "Contour Lines - 90m"<br>
WMS_SRS "EPSG:4326"<br>
GML_INCLUDE_ITEMS "all"<br>
END<br>
<br>
CONNECTIONTYPE POSTGIS<br>
CONNECTION "host=192.168.10.15 port=5432<br>
dbname=my_spatial_db user=admin password=******"<br>
DATA "geom FROM atest using unique
gid using srid=4326"<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>
</div>
</div>
_______________________________________________<br>
mapserver-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:mapserver-users@lists.osgeo.org"
target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users"
target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
</blockquote>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Greetings<br>
Cheryl<br>
<br>
<br>
</blockquote>
</body>
</html>