[mapguide-internals] ogr postgis layer problems

Traian Stanev traian.stanev at autodesk.com
Tue Jan 30 23:34:06 EST 2007


Hi Frank,
 
I am applying the FID filter as an attribute filter, using the following call:
 
layer->SetAttributeFilter(mbattrsql);

where layer is an OGRLayer. After that in the case of Select I call layer->ResetReading() before reading the resulting features. I basically treat the string representation of the FDO attribute filter (mbattrsql) as a valid OGR filter. I don't know what OGR does underneath, may be it uses ExecuteSQL -- you tell me. I do acknowledge that doing this for attribute filters is extremely hopeful (meaning that the assumption that it works is based on pure belief in miracles :-), but I did do some limited testing and other attribute filters worked well as layer filters in MapGuide.

In general I spent very little time on the filter handling in the OGR provider since I didn't have much time and wasn't sure how useful it would be. I'm willing to fix it up if it turns out to be the problem. In particular, I didn't bother to support queries which are more than a combination of one spatial filter and one attribute filter -- which is about par for most MapGuide operations.

 

Traian

P.S. the provider Paul is using is compiled with GDAL 1.3.2.

 

	-----Original Message----- 
	From: mapguide-internals-bounces at lists.osgeo.org on behalf of Frank Warmerdam (External) 
	Sent: Wed 1/31/2007 12:31 AM 
	To: MapGuide Internals Mail List 
	Cc: 
	Subject: Re: [mapguide-internals] ogr postgis layer problems
	
	

	Traian Stanev wrote:
	> What you are describing seems to me to lead to a bug in the OGR provider
	> in the case where a filter is used that is a combination of a spatial
	> filter and FID filter, which is what the selection rendering code uses
	> to get the features that have to draw as selected overlay. Since the
	> selection itself seems to work for you, my guess is that the provider
	> messes something up during such a query that results in a confusion
	> during subsequent queries.
	> My guess could be wrong though... To narrow it down, I can look over the
	> code and check for obvious flaws (I don't have the time to install
	> PostGIS right now), and you can try connecting to an SHP file with the
	> OGR provider to see if selection works for that. Another thing you can
	> try is run the server in interactive mode and check for any console
	> output. The provider (and OGR itself) will sometimes printf stuff to the
	> console.
	
	Paul,
	
	I think Traian's approach is good.  See if you can reproduce the problem
	with other providers to isolate whether it is a systematic problem, or
	a driver specific problem.
	
	Traian - does the OGR provider use ExecuteSQL() at all to get results?
	Setting attributes filters on ExecuteSQL() results often didn't work
	before the 1.4.0 release of GDAL/OGR.  So if the FID filter is being
	applied as an attribute filter and you are using ExecuteSQL() to get
	the resultset this might explain it.
	
	Best regards,
	--
	---------------------------------------+--------------------------------------
	I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
	light and sound - activate the windows | http://pobox.com/~warmerdam
	and watch the world go round - Rush    | President OSGeo, http://osgeo.org
	
	_______________________________________________
	mapguide-internals mailing list
	mapguide-internals at lists.osgeo.org
	http://lists.osgeo.org/mailman/listinfo/mapguide-internals
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-internals/attachments/20070130/fd4fb005/attachment-0001.html


More information about the mapguide-internals mailing list