Re: how to check if a point is contained in a polygon ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Julien Cigar <jcigar(at)ulb(dot)ac(dot)be>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: how to check if a point is contained in a polygon ?
Date: 2008-05-07 15:12:29
Message-ID: 7470.1210173149@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Julien Cigar <jcigar(at)ulb(dot)ac(dot)be> writes:
> Is there an SQL function to check if a point is contained in a polygon
> shape (before I start to write my own) ?

> I tried something like :

> rodentia=> select point '(-8,25)' <@ polygon
> '((-3,10),(8,18),(-3,30),(-10,20))';
> ERROR: operator does not exist: point <@ polygon
> HINT: No operator matches the given name and argument type(s). You may
> need to add explicit type casts.

> ... but without success as you can see ;\

I think you are reading recent documentation and trying to apply it to
an old Postgres version. <@ had some other name before 8.2 ... check
the docs for whatever you are running.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2008-05-07 15:24:21 Re: Insert with pl/pgsql trigger
Previous Message Richard Huxton 2008-05-07 14:38:17 Re: how to check if a point is contained in a polygon ?