[gdal-dev] Intersection of polygon layers
yosukesabai at gmail.com
Fri Nov 5 15:08:41 EDT 2010
I am trying to calculate intersection of two polygon layers with
polygons. I searched threads, found following thread, and what I got
was that OGR/GEOS provide me to intersection of two features, but I
have to write something in order to perform this operation for two
layers with multiple features.
Open source vector geoprocessing libraries?
Intersect of two shapefiles
My questions are:
1. Did I miss something? Is there development of library which takes
two polygon layers to calculate intersection or other basic geometry
operations that i find in OGR?
2. Assuming no to above, I got started writing code using python
binding. Not having too much experience, I codes to go through all
possible pair (complete bipartite), test with intersect, then run
intersection if it returns true. I am wondering there is faster way
to do this. I am thinking something like get envelope polygon of each
feature first, and then test intersection of them and then perform
intersect operation only when first test passes (i assume that it is
easier to test intersect if there are only handful of vertices as
oppose to hundreds of vertices in my case).
Right now I am trying with layer of hundreds of thousands of polygons
vs. thousands of polygon, and it seems to be taking 10s of hours to
finish in my environment.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev