Monday, 12 September 2016

postgis - ST_Instersects and Join result to new table



I am having two tables, table1 and table2.


I want to know which parts of table2 intersect with table1. Having that information, I want to write the attributes from table2 into table1 (where they intersect) and create a completely new table3 of it. I want to preserve the geometry (polygons) from table1


sketch


CREATE TABLE table3 AS
SELECT t1.*, t2.c, t2.d FROM table1 t1
JOIN table2 t2
ON ST_Intersects(t1.geom, t1.geom);

Would that give me my desired result?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...