<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY dir=ltr text=#000000 bgColor=#ffffff>
<DIV>&nbsp;</DIV>
<DIV>Wait, from this it looks like it takes the BBOX (envelope) of the filter and sends that to PostGIS...? That may explain things.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT size=2>-----Original Message----- <BR><B>From:</B> mapguide-users-bounces@lists.osgeo.org&nbsp;on behalf of&nbsp;Kenneth, GEOGRAF A/S <BR><B>Sent:</B> Wed 6/13/2007 5:42 PM <BR><B>To:</B> MapGuide Users Mail List <BR><B>Cc:</B> <BR><B>Subject:</B> Re: [mapguide-users] OGR / GEOS selection problem<BR><BR></FONT></DIV>It is actually forwarded to PostGIS:<BR><BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OGREnvelope&nbsp; sEnvelope;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_poFilterGeom-&gt;getEnvelope( &amp;sEnvelope );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osWHERE.Printf("WHERE %s &amp;&amp; SetSRID('BOX3D(%.12f %.12f, %.12f %.12f)'::box3d,%d) ",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pszGeomColumn,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sEnvelope.MinX, sEnvelope.MinY,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sEnvelope.MaxX, sEnvelope.MaxY,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nSRSId );<BR></TT><BR><BR>Not too good with PostGIS syntax, but since the m_poFilterGeom is the filter used (a small square in this case) it reads:<BR>"Select from geometry_column where features are within the bbox of the filer"<BR><BR>Which should be quite ok, unless they have a similar idea of optimizing this to a BBOX test, as OGR does.<BR><BR>Anyway, I can confirm that Traians fix works with MapInfo TAB files, but NOT with PostGIS :(<BR><BR><PRE class=moz-signature cols="72">Regards, Kenneth, GEOGRAF A/S
</PRE><BR><BR>Traian Stanev skrev: 
<BLOCKQUOTE cite="" type="cite"><PRE>To put test data into PostGres I use the tool that comes with it that
can import SHP files into the database.

I think it's called shp2pgsql.


Traian


-----Original Message-----
From: <A class=moz-txt-link-abbreviated href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</A>
[<A class=moz-txt-link-freetext href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</A>] On Behalf Of Kenneth,
GEOGRAF A/S
Sent: Wednesday, June 13, 2007 3:21 PM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] OGR / GEOS selection problem

I tried it with MapInfo TAB files, and it works fine.

Maciej, can you post an SQL dump of one of the PostGIS tables?

I have installed PostGIS on my machine for testing, but I have no data, 
and no luck getting Fdo2Fdo working with FDO OGR.

Regards, Kenneth, GEOGRAF A/S



Traian Stanev skrev:
  </PRE>
<BLOCKQUOTE type="cite"><PRE>Well, I only tried it with SHP files and am pretty sure it fixed the
problem for SHP files (I did a before and after test, on a polygon
    </PRE></BLOCKQUOTE><PRE>that
  </PRE>
<BLOCKQUOTE type="cite"><PRE>had the same problem as your screenshot). May be the PostGIS OGR
    </PRE></BLOCKQUOTE><PRE>driver
  </PRE>
<BLOCKQUOTE type="cite"><PRE>does something else, like forward the spatial filter to PostGIS? In
    </PRE></BLOCKQUOTE><PRE>that
  </PRE>
<BLOCKQUOTE type="cite"><PRE>case, may be I need to upgrade my PostGIS SDK...? Anybody know the
answer to that one?


Traian


-----Original Message-----
From: <A class=moz-txt-link-abbreviated href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</A>
[<A class=moz-txt-link-freetext href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</A>] On Behalf Of Maciej
Skorczewski
Sent: Wednesday, June 13, 2007 12:29 PM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] OGR / GEOS selection problem

Traian


i have still this same error...

take a look on screen.

<A class=moz-txt-link-freetext href="http://imagepolis.com/images/20070613819095046.JPG">http://imagepolis.com/images/20070613819095046.JPG</A>

<A class=moz-txt-link-freetext href="http://imagepolis.com/images/20070613818181055.JPG">http://imagepolis.com/images/20070613818181055.JPG</A>

<A class=moz-txt-link-freetext href="http://imagepolis.com/images/20070613434408347.JPG">http://imagepolis.com/images/20070613434408347.JPG</A>


Maciek

ps. and i still can't use SetSelectionXML...

    </PRE></BLOCKQUOTE><PRE><A class=moz-txt-link-freetext href="http://www.nabble.com/SetSelectionXML-on-layer-from-database-%28PostgreS">http://www.nabble.com/SetSelectionXML-on-layer-from-database-%28PostgreS</A>
  </PRE>
<BLOCKQUOTE type="cite"><PRE>QL-%3EPostgGIS%29-tf3900386s16610.html

(tiny of this url to forum)
<A class=moz-txt-link-freetext href="http://tiny.pl/fdtn">http://tiny.pl/fdtn</A>


maciek skorczewski



_______________________________________________
mapguide-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</A>
<A class=moz-txt-link-freetext href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</A>


_______________________________________________
mapguide-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</A>
<A class=moz-txt-link-freetext href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</A>
  
    </PRE></BLOCKQUOTE><PRE>_______________________________________________
mapguide-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</A>
<A class=moz-txt-link-freetext href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</A>


_______________________________________________
mapguide-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</A>
<A class=moz-txt-link-freetext href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</A>
  </PRE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>