[mapserver-users] Query on WFS Layer: Fatal error: [MapServer Error]: msQueryByShape(): No matching record(s) found

Francesco Sozzi fsozzi at intercad.ch
Wed Apr 20 10:37:34 EDT 2011


Hi list,

I have a big problem on querying a WFS layer.
Here you find both script and layer definition on mapfile. The problem is
that $result->shapeindex has value 0 and I get the error:
"Fatal error: [MapServer Error]: msQueryByShape(): No matching record(s)
found."

Any suggestions?

Best regards

Francesco

-----------------------------------------------------
SCRIPT
-----------------------------------------------------
$qresult = @$layer->queryByRect($myrect);	

	

//get all results
$numResults = $layer->getNumResults();

for ($i=0; $i < $numResults; $i++)
{
	$result = $layer->getResult($i);
	
	$layer->open();
	$shape = $layer->getFeature($result->shapeindex);
	$layer->close();
}

-----------------------------------------------------
MAPFILE LAYER DEFINITION
-----------------------------------------------------

LAYER
	NAME "parchiGR"
	GROUP "Grigioni"
	TYPE POLYGON
	STATUS DEFAULT
	CONNECTIONTYPE WFS	
	CONNECTION "http://mapserver1.gr.ch/wfs/wildruhezonen?"

	CLASSITEM "beschlussjahr"

	METADATA
		"wfs_typename"
"Eidg_Jagdbanngebiete_und_Schweizerischer_Nationalpark"	
		"wfs_version"           "1.0.0"
		"wfs_request_method"    "GET"
		"wfs_connectiontimeout" "100"
		"wfs_maxfeatures"       "1000"
		
	END	

	DUMP TRUE           
	PROJECTION
		"init=epsg:21781"
	END

	CLASS		
		NAME "anno 2004"
		EXPRESSION "2004"
		COLOR 159 255 159
		OUTLINECOLOR 250 20 10	
		TEMPLATE "templates/default.html"	
	END

	CLASS		
		NAME "anno 1980"
		EXPRESSION "1980"
		COLOR 140 198 255
		OUTLINECOLOR 250 20 10	
		TEMPLATE "templates/default.html"	
	END

	CLASS		
		NAME "altro anno"
		COLOR 192 192 192
		OUTLINECOLOR 250 20 10	
		TEMPLATE "templates/default.html"	
	END

END



More information about the mapserver-users mailing list