Re: Finding nearest location, calculating distance - best way to store and sort info?
Re: Finding nearest location, calculating distance - best way to store and sort info?
- Subject: Re: Finding nearest location, calculating distance - best way to store and sort info?
- From: Paul D Yu <email@hidden>
- Date: Wed, 3 May 2006 16:18:09 -0400
Matt
I've implemented something like this at www.superdiem.com, where you can find the nearest airports to a zipcode location.
I wrote a query that modeled the suggested Great Circle (based on lat-long) calculation in EOQualifiers, load them into a fetchSpecification and do ec.objectsWithFetchSpecification( fs ); and the result set is what you're looking for.
If you are looking for calculating distance between two lat-longs then that is a simple calculation once you have selected your two pairs. I would not recommend pre-calculating all you distance pairs. May be if you are looking to shortest distance calculations you would need to do that, but I didn't find that necessary.
Paul |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden