title: Need to determine which polygon my current position falls into
body: <p>I'm about to embark on an IOS project aimed at retrieving local geological information. I plan on using Google App Engine for the backend, with Python. My issue is that not all the Python libraries one might need, such as <a href="http://pypi.python.org/pypi/Shapely" rel="nofollow">Shapely</a> , are available on App Engine, , because they depend on low-level C libraries. So I'm thinking that strategic preprocessing may be the way to go.</p>
  
  <p>I'm going to be working from KML data files that encode information about geological formations. For each state, there is a patchwork of polygons that covers the state, and each polygon (color coded in Google Earth) corresponds to a geological formation. For example <a href="http://mrdata.usgs.gov/geology/state/kml/nhgeol.kml" rel="nofollow">nhgeol.kml</a></p>
  
  <p>In another project , I've used the Python <a href="http://pypi.python.org/pypi/geomodel/0.2.0" rel="nofollow">GeoModel</a> library, and that plays nicely with App Engine. But for that project, my data consisted of discrete points, and GeoModel is great for preprocessing that kind of data, so that you can do "proximity fetches".</p>
  
  <p>In this project, I'll want to know, given my current position, what polygon I'm in. One approach would be to precompute a gridwork of geocells, determining which polygon each cell is in. Then this problem would reduce to one that GeoModel could handle. But I don't have a feel for how feasible this is.</p>
  
  <p>Once I know what polygon I'm in, I'll have a pointer to information about the particular geological formation. That's what I'll be presenting to the end user.</p>
  
  <p>I'd very much appreciate it if some folks would suggest whether this approach makes sense, or whether perhaps I'm missing something much more straightforward.</p>