title: Conversion of miles to latitude and longitude degrees using geopy
body: <h2>Background</h2>
  
  <p>I want to add a model manager function that filters a queryset based on the proximity to coordinates. I found this <a href="http://fairviewcomputing.com/blog/2008/04/16/django-geography-hacks/" rel="nofollow">blog posting</a> with code that is doing precisely what I want. </p>
  
  <h2>Code</h2>
  
  <p>The snippet below seems to make use of <a href="http://code.google.com/p/geopy/" rel="nofollow">geopy</a> functions that have since been removed. It coarsely narrows down the queryset by limiting the range of latitude and longitude.</p>
  
  <pre><code>    # Prune down the set of all locations to something we can quickly check precisely
      rough_distance = geopy.distance.arc_degrees(arcminutes=geopy.distance.nm(miles=distance)) * 2
      queryset = queryset.filter(
          latitude__range=(latitude - rough_distance, latitude + rough_distance), 
          longitude__range=(longitude - rough_distance, longitude + rough_distance)
      )
  </code></pre>
  
  <h2>Problem</h2>
  
  <p>Since some of the used geopy functions have been removed/moved, I'm trying to rewrite this stanza. However, I do not understand the calculations---barely passed geometry and my research has confused me more than actually helped me.</p>
  
  <p>Can anyone help? I would greatly appreciate it.</p>