I need to identify quickly to which polygons a set of points belong in Django 1.9.
First option is to loop through all polygons and check which points they contain:
for countrypolygon in countrypolygons:
placesinthecountry = Place.objects.filter(lnglat__intersects=countrypolygon.geom)
This takes a lot of time as I need to loop through a lot of polygons.
Is it possible to do the opposite, i.e. loop through each point and immediately get the polygons in which it is contained?