Milo van der Linden milovanderlinden at gmail.com
Fri Aug 8 17:47:48 BST 2008

```Since all of these calculations are planar and near estimates, perhaps
it would be good to use libraries that particularly cope with
"geospatial operations"

perhaps GOES might be a good starting point:

http://trac.osgeo.org/geos/

Kind regards,

Milo

"Don't reinvent wheels, make beautiful cars!"

Rogier Wolff wrote:
> On Fri, Aug 08, 2008 at 04:02:10PM +0100, David Earl wrote:
>> On 08/08/2008 14:30, Fire Girl wrote:
>>> I am working with OSM data, and would like to be able to spec out 5 mile
>>> bounding boxes from certain GPS points.
>>>
>>> After research into this problem, I am to understand that each degree of
>>> latitude is approximately 69 miles (111 kilometers) apart with a slight
>>> variance (68.703 - 69.407 miles) between the equator and the poles, and
>>> that each degree of longitude is widest at the equator @ 69.172 miles
>>> (111.321 kilometers) and gradually shrinks to zero at the poles. : ) :)
>>>
>>> So what does this mean?  If I want to take a input point, like lets say,
>>>
>>> 167.9 lat
>>> -29.1 lon
>>>
>>> or
>>>
>>> -63.1
>>> 18.1
>>>
>>> Can someone say with authority, what the 'calculus' would be to
>>> definitivly construct a NSWE bounding box with a 5 mile radius around
>>> those points?.... that would be basically close enough or accurate? :)
>
> A degree longitude is about 40000km / 360 * cos (lat).
> A degree lattitude is about 40000km / 360.
>
> So 5 miles would be in longitude:
>    5 / (40000 / 1.609 / 360 * cos (lat))
>         km/circle    degrees/circle
>    mile         km/mile
>
>
>    5 / (40000 / 1.609 / 360)
>         km/circle    degrees/circle
>    mile         km/mile
>
> lattidude. This comes to about 0.0725, 0.0725/cos(lat) degrees for
> 5 miles (lat, lon).
>
> This defines an almost-square where the circle would be almost
> completely inside.
>
> This especially doesn't work near the poles.
>
> 	Roger.
>

```