Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 22nd, 2002, 11:24 AM
boldingl boldingl is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 18 boldingl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question GPS / GIS algorithm

Does anybody know the best way to use GPS data or GIS data to figure out what places are within X km/miles of a given coordinate, and how far from the given coordinate they are?

This looks like it would be an incredibly expensive calculation, as you'd need to calculate the area of the bounded region, and then find all places within this bounds. You'd then need to work out the distance form the center of the bounded region to each point.

Is there another, simpler way (with less overhead)?

Reply With Quote
  #2  
Old February 22nd, 2002, 11:38 AM
andnaess andnaess is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2001
Location: Oslo
Posts: 1,516 andnaess User rank is Private First Class (20 - 50 Reputation Level)andnaess User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
In abstract, this problem sounds identical to this:
http://forums.devshed.com/showthrea...0984&forumid=43

And again, the solution lies in improving the datastructure. If you can organize the places in for example boxes (buckets), then you can greatly speed up the computation.
__________________
--
Regards
André Nćss

Puritanism: The haunting fear that someone, somewhere may be having fun

Reply With Quote
  #3  
Old February 25th, 2002, 11:05 PM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,173 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 24
There might be some useful links or ideas here as well:

http://forums.devshed.com/showthrea...16926&forumid=4

Reply With Quote
  #4  
Old February 27th, 2002, 03:41 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 12 m 27 sec
Reputation Power: 56
You definitely don't need to calculate the area of the bounded region or anything like that. It's not really that difficult to do, but to get accurate measurements, you need to convert to spherical coordinates.

I implemented this exact method at www.anisite.com (click on a state on the map, and you will get tower location points on a zoomable map, with a drop-down in the right-hand side that shows a radius search, with relative distances from the center of your last map-click)

If you use the right formula, there is very little performance hit on your system. In fact, at one time I even implemented the radius search in Javascript, and it worked fine processing hundreds of coordinates.

I got the basic formula from the "Ask Dr. Math" forum. See the following links for the answer:
http://mathforum.org/dr.math/problems/longandlat.html
http://mathforum.org/dr.math/proble...ad12.11.97.html
http://mathforum.org/dr.math/problems/atlas5.21.96.html

This question has been asked so many times that there are many more links at the forum. Do a search for "Spherical coordinate search", and you will see.
__________________
The real n-tier system:

FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

Amazon wishlist -- rycamor (at) gmail.com

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > GPS / GIS algorithm


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT