From: elein <elein@varlena.com>
To: David <de4@kent.ac.uk>
Cc: pgsql-sql@postgresql.org
Subject: Re: searching polygons
Date: Sat, 21 Feb 2004 18:12:59 -0800
Message-ID: <20040221181259.H25537@cookie.varlena.com> (raw)
In-Reply-To: <006501c3f588$807b56b0$9b660c81@ad.kent.ac.uk>
References: <006501c3f588$807b56b0$9b660c81@ad.kent.ac.uk>
You should use some variation of overlaps or
contains within. There is some discussion and
a list of operators in Issue #61 of General Bits.
( http://www.varlena.com/GeneralBits/61 )
I would also suggest looking at the geometric
operators in the documentation. You may have
to cast the polygon to a circle to use the operators,
but it will still tell you whether the smaller polys
are contained within or overlap the larger.
elein
On Tue, Feb 17, 2004 at 07:01:51PM -0000, David wrote:
> What query would i have to use to search for an item using a polygon as a
> parameter? (i.e a very large polygon that would identify smaller polygons
> within it) ideally i would like to give postgresq a series of co-ordinates
> and then have it return all those results whose polygons fall into that set
> of co-ordinates, is this possible?
>
> at the moment all i can think of is
>
>
> select * from species where location between '(0,0)' and '(1000,0)' and
> '(0, 1000)' and '(1000; 1000)';
>
> I think im way off, any suggestions?
>
> Cheers Dave
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: elein@varlena.com, de4@kent.ac.uk
Subject: Re: searching polygons
In-Reply-To: <20040221181259.H25537@cookie.varlena.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox