Monday, February 27, 2017

finding intersection of linestring and list of polygon

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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b40ff554-36fe-4a4b-9701-07dc1d1c82a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment