[postgis-users] help with WMS query Mapserver and postgis

Edu Montaña edumon20 at hotmail.com
Sat Mar 10 04:10:02 PST 2007


Hello, I'm newbie in mapserver and postgis, and I have a problem that I 
don't know how to fix it. I have installed mapserver in a debian system with 
postgis, but when I make a request WMS I obtain the following error:

msDrawMap(): Image handling error. Failed to draw layer named 'layer_07'.
prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual 
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT 
asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from layer_07 
WHERE the_geom && setSRID('BOX3D(63208.0999421528 
4203763.49990343,404291.899999981 4487999.99999998)'::BOX3D, 
find_srid('','layer_07','the_geom') )' Postgresql reports the error as 
'ERROR: function setsrid(box3d, integer) does not exist HINT: No function 
matches the given name and argument types. You may need to add explicit type 
casts. ' More Help: Error with POSTGIS data variable. You specified 'check 
your .map file'. Standard ways of specifiying are : (1) 'geometry_column 
from geometry_table' (2) 'geometry_column from (sub query) as foo using 
unique column name using SRID=srid#' Make sure you put in the 'using unique 
column name' and 'using SRID=#' clauses in. For more help, please see 
http://postgis.refractions.net/documentation/ Mappostgis.c - version of Jan 
23/2004.

I don't understand this error because I have defined in my database the 
function setsrid.
I tried to define in the data declaration in my .map file the following:
	DATA "the_geom from layer_07 using unique the_geom using SRID=23030"
but it doesn't work.
My WMS query is: 
http://192.168.0.66:80/cgi-bin/mapserv40/mapserv?map=/usr/local/apache2/htdocs/mapservertest.mapSERVICE=WMS&Request=GetMap&LAYERS=layer_07&format=image/jpeg&bbox=222966.0,4416557.0,223027.0,4416597.0&srs=EPSG:23030&styles=default&VERSION=1.1.1&Height=600&Width=500
My layer declaration on the .map file is the following:

	LAYER
		NAME "layer_07"
		TYPE POLYGON
		STATUS ON
		CONNECTIONTYPE POSTGIS
		CONNECTION "host=192.168.0.147 dbname=testdb user=postgres 
password=postgres port=5432"
		DATA "the_geom from layer_07"
                TRANSPARENCY 25

                CLASS
                	NAME 'layer_07'
                	COLOR		188 229 193
                        OUTLINECOLOR	0 0 0
                END

		METADATA
                	"wms_name" "layer_07"
			"wms_title" "Layer 07."
		END

		PROJECTION
			"init=epsg:23030"
		END
	END


I hope that your can help me, it very urgent.

Thanks in advance

P.D.: Sorry for my poor english

_________________________________________________________________
Acepta el reto MSN Premium: Protección para tus hijos en internet. 
Descárgalo y pruébalo 2 meses gratis. 
http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_proteccioninfantil




More information about the postgis-users mailing list