[Mapserver-users] Error with Postgis data variable

Dylan Keon keon at nacse.org
Wed Jan 21 03:01:41 EST 2004


I've been getting the same error, thinking it must be a permissions 
problem after seeing the various replies recently.  But my 
database-level users, grants, etc. have been fine all along.  Applying 
the fix from this post is what finally worked for me: 
http://postgis.refractions.net/pipermail/postgis-users/2003-December/003653.html 
.

This recent post explains the problem of cursors not being closed:
http://postgis.refractions.net/pipermail/postgis-users/2004-January/003814.html

I also tried MapServer from CVS - the fix(es) must have been committed, 
because that mappostgis.c works fine for me when querying.  My queries 
just bomb when using mappostgis.c from MS 4.0.1.

I'm using PostgreSQL 7.4.1 and PostGIS 0.8.1 on Linux, BTW.

--Dylan


Pericles S. Nacionales wrote:
> These might be what you're looking for:
> http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0401/msg00331.html
> 
> You might also want to look at the original message:
> http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0401/msg00291.html
> 
> Cheers!
> Perry N.
> 
> On Tue, 2004-01-20 at 19:54, Matthew Haines wrote:
> 
>>I'm having what seems to be a very common problem, but I've stripped the 
>>code down to the bone and am at a loss as to what to do next.  I've read the 
>>archives for three hours now and am not finding anything.
>>
>>Mandrake 9.2 Linux, PostgreSQL 7.4, Postgis 0.8.0, Mapserver 4.0.1
>>
>>I've chopped my .map file down to the bone:
>>LAYER
>>	NAME "bk_taxlots"
>>
>>	CONNECTIONTYPE postgis
>>	CONNECTION "user=website dbname=nycpr"
>>	DATA "the_geom from brooklyn_taxlots"
>>
>>	MAXSCALE 25000
>>	TYPE POLYGON
>>	STATUS DEFAULT
>>
>>	CLASS
>>		NAME "Residential, 1-2 Fam"
>>		OUTLINECOLOR 32 32 32
>>	END
>>END
>>
>>and I'm executing shp2img and get this:
>>
>>msDrawMap(): Image handling error. Failed to draw layer named 'bk_taxlots'. 
>><br>
>>prep_DB(): Query error. 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 
>>brooklyn_taxlots WHERE the_geom && setSRID('BOX3D(997814 178997,999214 
>>180397)'::BOX3D, find_srid('','brooklyn_taxlots','the_geom') )' <br><br>
>>
>>Postgresql reports the error ''<br><br>
>>
>>More Help:<br><br>
>>
>>Error with POSTGIS data variable. You specified '&lt;check your .map 
>>file&gt;'.<br>
>>Standard ways of specifiying are : <br>
>>(1) 'geometry_column from geometry_table' <br>
>>(2) 'geometry_column from (&lt;sub query&gt;) as foo using unique &lt;column 
>>name&gt; using SRID=&lt;srid#&gt;' <br><br>
>>
>>Make sure you put in the 'using unique  &lt;column name&gt;' and 'using 
>>SRID=#' clauses in.




More information about the mapserver-users mailing list