<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Sure, but the actual geometric operation is what matters. If it
ends up doing a BBOX, it would not be right. It needs to do Intersects.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Kenneth,
GEOGRAF A/S<br>
<b>Sent:</b> Thursday, June 14, 2007 4:15 AM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> Re: [mapguide-users] OGR / GEOS selection problem<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>It should not work if you make a polygon selection.<br>
Tooltip and Click sends a square, so the envelope of the filter should be the
same as the filter<br>
<br>
<o:p></o:p></p>

<pre>Regards, Kenneth, GEOGRAF A/S<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre>

<p class=MsoNormal><br>
<br>
Traian Stanev skrev: <o:p></o:p></p>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Wait, from this it looks like it takes the BBOX (envelope)
of the filter and sends that to PostGIS...? That may explain things.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<blockquote style='margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt'>-----Original
Message----- <br>
<b>From:</b> <a href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>&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</span><o:p></o:p></p>

</div>

<p class=MsoNormal>It is actually forwarded to PostGIS:<br>
<br>
<tt><span style='font-size:10.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
OGREnvelope&nbsp; sEnvelope;</span></tt><span style='font-size:10.0pt;
font-family:"Courier New"'><br>
<br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_poFilterGeom-&gt;getEnvelope(
&amp;sEnvelope );</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osWHERE.Printf(&quot;WHERE %s
&amp;&amp; SetSRID('BOX3D(%.12f %.12f, %.12f %.12f)'::box3d,%d) &quot;,</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pszGeomColumn,</tt><br>
<tt>&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,</tt><br>
<tt>&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,</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
nSRSId );</tt><br>
</span><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>
&quot;Select from geometry_column where features are within the bbox of the
filer&quot;<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>
<br>
<o:p></o:p></p>

<pre>Regards, Kenneth, GEOGRAF A/S<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp; <o:p></o:p></pre>

<p class=MsoNormal><br>
<br>
Traian Stanev skrev: <o:p></o:p></p>

<pre>To put test data into PostGres I use the tool that comes with it that<o:p></o:p></pre><pre>can import SHP files into the database.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I think it's called shp2pgsql.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Traian<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: <a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a><o:p></o:p></pre><pre>[<a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>] On Behalf Of Kenneth,<o:p></o:p></pre><pre>GEOGRAF A/S<o:p></o:p></pre><pre>Sent: Wednesday, June 13, 2007 3:21 PM<o:p></o:p></pre><pre>To: MapGuide Users Mail List<o:p></o:p></pre><pre>Subject: Re: [mapguide-users] OGR / GEOS selection problem<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I tried it with MapInfo TAB files, and it works fine.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Maciej, can you post an SQL dump of one of the PostGIS tables?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I have installed PostGIS on my machine for testing, but I have no data, <o:p></o:p></pre><pre>and no luck getting Fdo2Fdo working with FDO OGR.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Regards, Kenneth, GEOGRAF A/S<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Traian Stanev skrev:<o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>Well, I only tried it with SHP files and am pretty sure it fixed the<o:p></o:p></pre><pre>problem for SHP files (I did a before and after test, on a polygon<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp; <o:p></o:p></pre></blockquote>

<pre>that<o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>had the same problem as your screenshot). May be the PostGIS OGR<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp; <o:p></o:p></pre></blockquote>

<pre>driver<o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>does something else, like forward the spatial filter to PostGIS? In<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp; <o:p></o:p></pre></blockquote>

<pre>that<o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>case, may be I need to upgrade my PostGIS SDK...? Anybody know the<o:p></o:p></pre><pre>answer to that one?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Traian<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: <a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a><o:p></o:p></pre><pre>[<a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>] On Behalf Of Maciej<o:p></o:p></pre><pre>Skorczewski<o:p></o:p></pre><pre>Sent: Wednesday, June 13, 2007 12:29 PM<o:p></o:p></pre><pre>To: MapGuide Users Mail List<o:p></o:p></pre><pre>Subject: Re: [mapguide-users] OGR / GEOS selection problem<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Traian<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>i have still this same error...<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>take a look on screen.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><a
href="http://imagepolis.com/images/20070613819095046.JPG">http://imagepolis.com/images/20070613819095046.JPG</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><a
href="http://imagepolis.com/images/20070613818181055.JPG">http://imagepolis.com/images/20070613818181055.JPG</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><a
href="http://imagepolis.com/images/20070613434408347.JPG">http://imagepolis.com/images/20070613434408347.JPG</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Maciek<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>ps. and i still can't use SetSelectionXML...<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>&nbsp;&nbsp;&nbsp; <o:p></o:p></pre></blockquote>

<pre><a
href="http://www.nabble.com/SetSelectionXML-on-layer-from-database-%28PostgreS">http://www.nabble.com/SetSelectionXML-on-layer-from-database-%28PostgreS</a><o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>QL-%3EPostgGIS%29-tf3900386s16610.html<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>(tiny of this url to forum)<o:p></o:p></pre><pre><a
href="http://tiny.pl/fdtn">http://tiny.pl/fdtn</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>maciek skorczewski<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>mapguide-users mailing list<o:p></o:p></pre><pre><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>mapguide-users mailing list<o:p></o:p></pre><pre><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></pre></blockquote>

<pre>_______________________________________________<o:p></o:p></pre><pre>mapguide-users mailing list<o:p></o:p></pre><pre><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>mapguide-users mailing list<o:p></o:p></pre><pre><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre></blockquote>

<pre><o:p>&nbsp;</o:p></pre><pre style='text-align:center'>

<hr size=4 width="90%" align=center>

</pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>mapguide-users mailing list<o:p></o:p></pre><pre><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre></div>

</body>

</html>