[MAPSERVER-USERS] Query using template and WFS errorred on POSTGIS

G. Tiemens Gerben.Tiemens at grontmij.nl
Thu Oct 16 08:04:12 EDT 2008


Hello List,

I want to try to get certain features-attribute information back from my
postgis database via Mapserver.

I tried this in 2 ways:
Enabeling WFS in the mapfile and making a query layer.

Both requests generate errors on the Postgis Database and i can't discover
what is going wrong.

This is the error I get: 
DECLARE CURSOR can only be used in transaction blocks

When doing a WFS request, i get a bounding box (envelope), but no features
back
Error is in the logfile of the postgis.

When doing a Query (nquery)  i get the error in html back:
Content-type: text/html writeLog(): Unable to access file. hierzo.log
msPOSTGISLayerGetShape(): Query error. Error executing POSTGIS SQL statement
(in FETCH ALL): DECLARE mycursor2 BINARY CURSOR FOR SELECT
"gid"::text,"provincie"::text,"oid"::text,asbinary(force_collection(force_2d(the_geom)),'NDR')
from prov2007 WHERE OID = 1 -ERROR: DECLARE CURSOR can only be used in
transaction blocks More Help: msPOSTGISLayerRetrievePGVersion(): Query
error. Error executing POSTGIS statement
(msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for
(position('on' in version()) - 13)) msPOSTGISLayerRetrievePGVersion(): Query
error. Error executing POSTGIS statement
(msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for
(position('on' in version()) - 13)) msPOSTGISLayerRetrievePGVersion(): Query
error. Error executing POSTGIS statement
(msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for
(position('on' in version()) - 13)) msPOSTGISLayerRetrievePGVersion(): Query
error. Error executing POSTGIS statement
(msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for
(position('on' in version()) - 13)) msPOSTGISLayerRetrievePGVersion(): Query
error. Error executing POSTGIS statement
(msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for
(position('on' in version()) - 13)) 


Both queries are also done with shapefile data, and that works fine. I get
features back (wfs) or the template (nquery) is filled in correctly


Below the parts of my mapfile and templates.

Mapfile: 
LAYER     NAME 'pr2007'     TYPE POLYGON     CONNECTIONTYPE postgis    
CONNECTION 'host=127.0.0.1 user=***** dbname=*****'     DATA 'the_geom FROM
pr2007'     #DATA 'C:\Project\Downloads\OSM\Data\pr\pr2007'     PROCESSING
"CLOSE_CONNECTION=DEFER"  	METADATA       'ows_title' 'prov2007' 	 
"ows_abstract" "" 	  "ows_keywordlist" "" 	  "gml_featureid" "gid" ##
REQUIRED 	  "gml_include_items" "all"  ## Optional (serves all attributes
for layer) 	  "ows_srs" "EPSG:28992" 	 # "queryable" "true" 	 
"wfs_geometry_element_name" "the_geom" 	  "wfs_extent" "12500 380000 280000
550000"      END 	#DUMP TRUE     STATUS ON #DEFAULT     #opacity 100    
PROJECTION 		"init=epsg:28992"     END 	HEADER "imapheader.html" 	FOOTER
"imapfooter.html" 	CLASS 		COLOR 0 0 0  		TEMPLATE "bodytemplate.html" 		 
END   END


query template:
<area shape="poly" coords="[shpxy precision=0 proj=image]"
href="http://www.*****.nl/pr.hml?ID=[pr]>



Versions i use:
PostgreSQL + postgis 8.3
Mapserver:  MS4W :  5.2.0
Or FWtools:  5.3-dev

All on localhost, so no firewall/security issues whatsoever.


What is the possible mistake i make? Any possible plugins or settings wrong
in database?


Greetings and thanks for help.

Gerben



-- 
View this message in context: http://www.nabble.com/Query-using-template-and-WFS-errorred-on-POSTGIS-tp20012197p20012197.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list