finding intersection of linestring and list of polygon

39 views
Skip to first unread message

tazma...@gmail.com

unread,
Feb 27, 2017, 6:20:11 PM2/27/17
to Django users
Hi,

  I'm not sure if this is the right place for this or not - let me know if I should post somewhere else (GEOS mailing list).

  I have a large list (1000's) of polygons (django.contrib.gis.geos.Polygon), some of which overlap.  What is the most efficient way to find which polygons intersect with a LineString?

  I would have thought that turning the list of Polygon's into a MultiPolygon, then calling MultiPolygon.intersection with the line segment would give me the polygon that the line segment intersected on.  This does work, but it just returns the line segment itself.  I'm trying to go the other way.

  I was hoping for a faster mechanism than just filter'ing over the original polygon list and calling intersect's on it.

  I'm having to use Django 1.6.7 if that matters.

Thanks,
Taz
Reply all
Reply to author
Forward
0 new messages