<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">What you probably mean is that a query like <div>Select geom from mytable where ST_Intersects(geom,my_rectangular_selection) </div><div>is very efficient, right?</div><div>Do I have to be careful to create indexes, or is that done automatically when I add a geometrical column?</div><div><br></div><div><br><br>--- On <b>Tue, 11/24/09, Brian Modra <i><epailty@googlemail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Brian Modra <epailty@googlemail.com><br>Subject: Re: [postgis-users] Using a rectangular selection<br>To: "PostGIS Users Discussion" <postgis-users@postgis.refractions.net><br>Date: Tuesday, November 24, 2009, 5:00 AM<br><br><div class="plainMail">2009/11/23 Henri De Feraudy <<a ymailto="mailto:feraudyh@yahoo.com"
 href="/mc/compose?to=feraudyh@yahoo.com">feraudyh@yahoo.com</a>><br>><br>> Hi,<br>>   I'm working in planar coordinates. I have a Postgis database and<br>> for starters I want to limit my attention to all geometries that intersect a given rectangle (the "selection").<br>> I can imagine that one could enumerate all geometries and ask in each case if they<br>> intersect the rectangle, but that doesnt seem very efficient, so what do you suggest?<br><br>Use ST_Intersects<br><br>> I only need general guidance so I can look at the various parts of the doc.<br>> Later I'll be wanting to clip the geometies with this selection.<br>> Still later I'll want to consider polygonal selections.<br>> By the way I'm accessing the PostGis database via LibPQ and have written my application<br>> in Qt.<br>><br>> Thanking you in advance<br>> Henri<br>><br>> _______________________________________________<br>>
 postgis-users mailing list<br>> <a ymailto="mailto:postgis-users@postgis.refractions.net" href="/mc/compose?to=postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>><br><br><br><br>--<br>Brian Modra   Land line: +27 23 5411 462<br>Mobile: +27 79 69 77 082<br>5 Jan Louw Str, Prince Albert, 6930<br>Postal: P.O. Box 2, Prince Albert 6930<br>South Africa<br><a href="http://www.zwartberg.com/" target="_blank">http://www.zwartberg.com/</a><br>_______________________________________________<br>postgis-users mailing list<br><a ymailto="mailto:postgis-users@postgis.refractions.net" href="/mc/compose?to=postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users"
 target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></div></blockquote></div></td></tr></table>