Skip site navigation (1) Skip section navigation (2)

use off geometric types

From: dhoubrechts <dhoubrechts(at)cybernet(dot)be>
To: "pgsql-interfaces(at)postgresql(dot)org" <pgsql-interfaces(at)postgresql(dot)org>
Subject: use off geometric types
Date: 2003-02-27 20:56:09
Message-ID: 3E5E7B69.63B72758@cybernet.be (view raw or flat)
Thread:
Lists: pgsql-interfaces
I create a db : createdb geop
I log into the db :  psql geo
I create a table named poly :
geo=# create table poly (parc varchar(15), graphic polygon);

I populate the table : 
insert into poly values('A52','(2,1),(1,3),(2,5),(4,6),(6,4),(5,2)');
insert into poly values('A135','(3,3),(7,4),(8,2),(4,1)');

Now I would look i the first polygon overlaps the second using the
varchars for retriving the poly.
I could do it so :
geo=# select '((2,1),(1,3),(2,5),(4,6),(6,4),(5,2))'::polygon &&
'((3,3),(7,4),(8,2),(4,1))'::polygon;
 ?column?
----------
 t
(1 row)
Now I can I do to have something like :
geo=# select graphic::polygon  from poly where parc='A52' && select
graphic::polygon from poly where parc='A135';

Thanks for help
Didier.

pgsql-interfaces by date

Next:From: dhoubrechtsDate: 2003-02-27 21:00:02
Subject: use off geometric types
Previous:From: Terry Lee TuckerDate: 2003-02-27 20:20:10
Subject: Re: Advice Needed

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group