<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Dear list,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have troubles to get PostGIS to work with
MapServer.</FONT></DIV>
<DIV><FONT face=Arial size=2>I went through the PostGIS tutorial, using the
sampe data. PostGIS works great on the command line.</FONT></DIV>
<DIV><FONT face=Arial size=2>But then I tried to call PostGIS with the MapServer
as described in the tutorial adding the following layer to the map file of some
working sample maps of nboth GMap and Chameleon:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV>LAYER<BR> NAME "elections"<BR> CONNECTIONTYPE postgis<BR>
CONNECTION "host=localhost port=5432 dbname=bc password=[ I won't tell you! :-)
] user=postgres"<BR> DATA "the_geom from
bc_voting_areas"<BR> TYPE
POLYGON<BR> STATUS OFF<BR>
PROJECTION<BR> "proj=aea"<BR>
"ellps=GRS80"<BR> "lon_0=-126"<BR>
"lat_0=45"<BR> "lat_1=50"<BR>
"lat_2=58.5"<BR> "x_0=1000000"<BR> END<BR>
CLASS<BR> NAME "Voting Areas"<BR>
OUTLINECOLOR 0 0 0<BR> COLOR 255 255 200<BR>
END<BR>END</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>If the layer is disabled (STATUS OFF) then everything is OK. BUT if i
enable it, MapServer cannot render the map (image missing symbol in the
browser). I switched on the Apache error logging to see what happens. Here is an
extract of the error log. A column oid seems to be missing... But that does not
make me smarter. I got similar error logs with both GMap and
Chameleon.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>[Thu Nov 24 17:32:11 2005] [error] [client
127.0.0.1] PHP Warning: [MapServer Error]: msDrawMap(): Failed to draw
layer named 'elections'., referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:11 2005] [error] [client 127.0.0.1] in
C:\\ms4w\\apps\\chameleon\\htdocs\\common\\wrapper\\drawmap.php on line 533,
referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:11 2005] [error] [client 127.0.0.1] PHP Warning: [MapServer
Error]: prep_DB(): Error executing POSTGIS DECLARE (the actual query) statement:
'DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from
bc_voting_areas WHERE the_geom && setSRID('BOX3D(-1077436.43349587
-810519.362607715,6569519.15906088 5920600.07354032)'::BOX3D,
find_srid('','bc_voting_areas','the_geom') )' <br><br>, referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:11 2005] [error] [client 127.0.0.1] , referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:11 2005] [error] [client 127.0.0.1] Postgresql reports the error as
'ERROR: column "oid" does not exist, referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:11 2005] [error] [client 127.0.0.1] '<br><br>, referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:11 2005] [error] [client 127.0.0.1] , referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:11 2005] [error] [client 127.0.0.1] More Help:<br><br>,
referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] , referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] Error with POSTGIS data variable.
You specified '&lt;check your .map file&gt;'.<br>, referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] Standard ways of specifiying are :
<br>, referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] (1) 'geometry_column from
geometry_table' <br>, referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] (2) 'geometry_column from
(&lt;sub query&gt;) as foo using unique &lt;column name&gt;
using SRID=&lt;srid#&gt;' <br><br>, referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] , referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] Make sure you put in the 'using
unique &lt;column name&gt;' and 'using SRID=#' clauses in.,
referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] , referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] <br><br>For more help,
please see <A href="">http://postgis.refractions.net/documentation.php</A> ,
referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] , referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] <br><br>Mappostgis.c -
version of Jan 23/2004., referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] , referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] in
C:\\ms4w\\apps\\chameleon\\htdocs\\common\\wrapper\\drawmap.php on line 533,
referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR>[Thu Nov
24 17:32:12 2005] [error] [client 127.0.0.1] PHP Warning: Cannot modify
header information - headers already sent by (output started at
C:\\ms4w\\apps\\chameleon\\htdocs\\common\\wrapper\\drawmap.php:533) in
C:\\ms4w\\apps\\chameleon\\htdocs\\common\\wrapper\\drawmap.php on line 1476,
referer: <A
href="">http://localhost/chameleon/samples/sample_enhanced.phtml</A><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>I am quite deseperate: I tried different versions
of MS4W (1.0.3 and 1.2.2) but that did not change the situation.</FONT></DIV>
<DIV><FONT face=Arial size=2>I am using PostgreSQL 8.1 with the PostGIS included
with it under Windows XP Pro SP2.</FONT></DIV>
<DIV><FONT face=Arial size=2>Trying step by step different PostGIS tutorials I
get the same error.</FONT></DIV>
<DIV><FONT face=Arial size=2>I have tried this on 2 different computers and get
the same errors.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>What can be the problem? As opposed to what I have
read in the forum, in my situation ALL layers die when I try to get a layer via
PostGIS.</FONT></DIV>
<DIV><FONT face=Arial size=2>I previously used MySQL via ODBC but that gave me
trouble as well (I could not query the database, just dump a complete column).
This is why I decided to convert to PostGIS (which is MUCH better anyway for my
task).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=281043414-21112005><FONT face=Arial size=2>Thanks for your help
and your time.</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Cheers,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Carlo
Trönnberg</DIV></FONT></FONT></DIV></BODY></HTML>