I am thinking through the logic for efficiently overlaying ~10,000 points
on ~100 polys.  What I want in the end is a list of dicts holding the
string ID for the point and string ID for the intersecting Poly.   I have
an example with prepared geometries, but now I am working up an RTree
example to benchmark.

Here is the logic:

- I use RTree to create an index on my polys
- at the same time, I create a dict to lookup the string ID (stationID) for
the integer index value

- I loop through the points in my collection and test them against the
index.
- if only one intersection is returned, I grab the id and look up my
countyID.

- if my intersection operation on the index returns multiple poly IDs, I
need to test against the actual geometries.
  This is where I am struggling.  I don't see a way to access a specific
feature from a shapely collection based on a property.  My first idea is to
store the polygon features in a dictionary after reading them from the
shapefile.  This would give me access by ID.  At the same time, I am trying
to work within the Shapely data structures.

Does anyone have any suggestions on best practices for integrating RTree
and Shapely?  Specifically, how you relate geometry collections to RTree
indexes.

I will post a code example after I modify my current example to not use
external data sources.

Thanks,

David.
_______________________________________________
Community mailing list
Community@lists.gispython.org
http://lists.gispython.org/mailman/listinfo/community

Reply via email to