[postgis-users] Using a rectangular selection

Brian Modra epailty at googlemail.com
Tue Nov 24 07:28:10 PST 2009


2009/11/24 Henri De Feraudy <feraudyh at yahoo.com>
>
> What you probably mean is that a query like
> Select geom from mytable where ST_Intersects(geom,my_rectangular_selection)
> is very efficient, right?
> Do I have to be careful to create indexes, or is that done automatically when I add a geometrical column?

yes you need to add the gist index, otherwise it will be slow.

>
>
> --- On Tue, 11/24/09, Brian Modra <epailty at googlemail.com> wrote:
>
> From: Brian Modra <epailty at googlemail.com>
> Subject: Re: [postgis-users] Using a rectangular selection
> To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
> Date: Tuesday, November 24, 2009, 5:00 AM
>
> 2009/11/23 Henri De Feraudy <feraudyh at yahoo.com>
> >
> > Hi,
> >   I'm working in planar coordinates. I have a Postgis database and
> > for starters I want to limit my attention to all geometries that intersect a given rectangle (the "selection").
> > I can imagine that one could enumerate all geometries and ask in each case if they
> > intersect the rectangle, but that doesnt seem very efficient, so what do you suggest?
>
> Use ST_Intersects
>
> > I only need general guidance so I can look at the various parts of the doc.
> > Later I'll be wanting to clip the geometies with this selection.
> > Still later I'll want to consider polygonal selections.
> > By the way I'm accessing the PostGis database via LibPQ and have written my application
> > in Qt.
> >
> > Thanking you in advance
> > Henri
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
>
>
>
> --
> Brian Modra   Land line: +27 23 5411 462
> Mobile: +27 79 69 77 082
> 5 Jan Louw Str, Prince Albert, 6930
> Postal: P.O. Box 2, Prince Albert 6930
> South Africa
> http://www.zwartberg.com/
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



--
Brian Modra   Land line: +27 23 5411 462
Mobile: +27 79 69 77 082
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa
http://www.zwartberg.com/



More information about the postgis-users mailing list