[postgis-users] Intersection query help

White, Richard Richard.White at infoterra-global.com
Wed May 2 03:43:21 PDT 2012


Nicklas,

Perfect, thank you.

Regards,

Richard.

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Nicklas Avén
Sent: 02 May 2012 11:39
To: postgis-users at postgis.refractions.net
Subject: Re: [postgis-users] Intersection query help

how about:

CREATE TABLE intersections AS
 (SELECT ST_Intersection(table1.geom, table2.geom) as inter,
table2.gridref
 FROM table1, table2
 WHERE table2.gridref = 'NN')

:-)

HTH

Nicklas



On Wed, 2012-05-02 at 10:21 +0100, White, Richard wrote:
> Hi,
> 
> The following query works and returns a new table with all the
> intersections between table1 and table2
> 
> CREATE TABLE intersections AS
> (SELECT ST_Intersection(table1.geom, table2.geom) as inter
> FROM table1, table2
> WHERE table2.gridref = 'NN')
> 
> However, the new table "intersections" does not contain any of the
> attributes from either of the sources tables.
> 
> How would I get the column "table2.gridref" included in the new table?
> 
> Thanks.
> 
> Regards,
> 
> R. 
> 
> _______________________________________________
> 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

Infoterra Ltd. Is part of the Astrium GEO-Information Services Division and a wholly owned subsidiary of Astrium, Europe's leading space systems and services specialist.

Disclaimer. The information contained in this e-mail and its attachments are confidential and intended only for the use of the named addressee(s). If you are not the intended addressee, please do not read, copy, use or disclose this message or its attachments. If you have received this message in error, please notify the sender immediately and delete or destroy all copies of this message and attachments in all media. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Infoterra Ltd and shall not form part of any binding agreement.

Infoterra Limited a company registered in England under number 2359955 and having its registered office at Atlas House, 41 Wembley Road, Leicester, LE3 1UT. VAT number GB 476 0468 27. 

P Before printing, think about the environment 




More information about the postgis-users mailing list