find each geometry overlap python

Solutions on MaxInterview for find each geometry overlap python by the best coders in the world

showing results for - "find each geometry overlap python"
Leonie
30 Apr 2017
1from osgeo import ogr
2
3wkt1 = "POLYGON ((1208064.271243039 624154.6783778917, 1208064.271243039 601260.9785661874, 1231345.9998651114 601260.9785661874, 1231345.9998651114 624154.6783778917, 1208064.271243039 624154.6783778917))"
4wkt2 = "POLYGON ((1199915.6662253144 633079.3410163528, 1199915.6662253144 614453.958118695, 1219317.1067437078 614453.958118695, 1219317.1067437078 633079.3410163528, 1199915.6662253144 633079.3410163528)))"
5
6poly1 = ogr.CreateGeometryFromWkt(wkt1)
7poly2 = ogr.CreateGeometryFromWkt(wkt2)
8
9intersection = poly1.Intersection(poly2)
10
11print intersection.ExportToWkt()
12