<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6618.4">
<TITLE>Re: [mapguide-internals] ogr postgis layer problems</TITLE>
</HEAD>
<BODY dir=ltr>
<DIV>Hi Frank,</DIV>
<DIV> </DIV>
<DIV>I am applying the FID filter as an attribute filter, using the following
call:</DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<P>layer->SetAttributeFilter(mbattrsql);</P>
<P>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.</P>
<P>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.</P>
<P> </P>
<P>Traian</P>
<P>P.S. the provider Paul is using is compiled with GDAL 1.3.2.</P>
<P> </P></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT size=2>-----Original Message----- <BR><B>From:</B>
mapguide-internals-bounces@lists.osgeo.org on behalf of Frank
Warmerdam (External) <BR><B>Sent:</B> Wed 1/31/2007 12:31 AM <BR><B>To:</B>
MapGuide Internals Mail List <BR><B>Cc:</B> <BR><B>Subject:</B> Re:
[mapguide-internals] ogr postgis layer problems<BR><BR></FONT></DIV>
<P><FONT size=2>Traian Stanev wrote:<BR>> What you are describing seems to
me to lead to a bug in the OGR provider<BR>> in the case where a filter is
used that is a combination of a spatial<BR>> filter and FID filter, which
is what the selection rendering code uses<BR>> to get the features that
have to draw as selected overlay. Since the<BR>> selection itself seems to
work for you, my guess is that the provider<BR>> messes something up during
such a query that results in a confusion<BR>> during subsequent
queries.<BR>> My guess could be wrong though... To narrow it down, I can
look over the<BR>> code and check for obvious flaws (I don't have the time
to install<BR>> PostGIS right now), and you can try connecting to an SHP
file with the<BR>> OGR provider to see if selection works for that. Another
thing you can<BR>> try is run the server in interactive mode and check for
any console<BR>> output. The provider (and OGR itself) will sometimes
printf stuff to the<BR>> console.<BR><BR>Paul,<BR><BR>I think Traian's
approach is good. See if you can reproduce the problem<BR>with other
providers to isolate whether it is a systematic problem, or<BR>a driver
specific problem.<BR><BR>Traian - does the OGR provider use ExecuteSQL() at
all to get results?<BR>Setting attributes filters on ExecuteSQL() results
often didn't work<BR>before the 1.4.0 release of GDAL/OGR. So if the FID
filter is being<BR>applied as an attribute filter and you are using
ExecuteSQL() to get<BR>the resultset this might explain it.<BR><BR>Best
regards,<BR>--<BR>---------------------------------------+--------------------------------------<BR>I
set the clouds in motion - turn up | Frank Warmerdam,
warmerdam@pobox.com<BR>light and sound - activate the windows | <A
href="http://pobox.com/~warmerdam">http://pobox.com/~warmerdam</A><BR>and
watch the world go round - Rush | President OSGeo, <A
href="http://osgeo.org">http://osgeo.org</A><BR><BR>_______________________________________________<BR>mapguide-internals
mailing list<BR>mapguide-internals@lists.osgeo.org<BR><A
href="http://lists.osgeo.org/mailman/listinfo/mapguide-internals">http://lists.osgeo.org/mailman/listinfo/mapguide-internals</A><BR></FONT></P></BLOCKQUOTE>
</BODY>
</HTML>