Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Fiona is OGR's new, neat, Pythonic API
2
votes
Accepted
RTree spatial index does not result in faster intersection computation
Edit: To clarify this answer, I incorrectly believed that all the intersection tests took approximately the same amount of time. This is not the case. The reason I did not get the speed up I expecte …
9
votes
3
answers
6k
views
RTree spatial index does not result in faster intersection computation
Through the answers to this question the code has gone from this:
import fiona
from shapely.geometry import LineString, Polygon, MultiPolygon, shape
# Open each layer
poly_layer = fiona.open('polygon_layer.shp … for line in the_lines:
if poly.intersects(line):
covered_polygons[poly_id] = covered_polygons.get(poly_id, 0) + 1
where every possible intersection is checked, to this:
import fiona …
5
votes
1
answer
8k
views
How to efficiently determine which of thousands of polygons intersect with a linestring [duplicate]
I am using the Shapely intersects binary predicate to check whether each LineString intersects with any one of the Polygons:
import fiona
from shapely.geometry import LineString, Polygon, MultiPolygon … :
for line in the_lines:
if poly.intersects(line):
covered_polygons[poly_id] = covered_polygons.get(poly_id, 0) + 1
The above code takes a long time to run, and being new to Fiona …