Help me out with a search algorithm for flash memory

Status
Not open for further replies.

kskr1004

Junior Member level 3
Joined
Jun 8, 2007
Messages
26
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,446
Hi,
i have database file with lattitude,longitude and place name in spi based flash memory,and my contoller is interfaced with GPS receiver with pumps NMEA strings .from string i am taking lattitude and longitude .present lattitude and longitude values must be serched in flash memory.if the values match in flash memory place name should be displayed. i need best serching algorthims.


if anybody have any idea how to search .please reply me
tahns&regards
 

Re: need help urgently

how have you arranged the data in your memory ....
 

Re: need help urgently

HI,
My flash has 32 sectors each contain 256 pages, so totally i have 8192 pages.for example +17.2345(lat),+078.345(Long),Delhi*,i wiil be going to write in to flash.like this for whole india i have store in the flash memory.lat and long will be in ascending order.

Thanks&Regards
 

Re: need help urgently

One mechanism I had used earlier was to store data based on the road lines (for Car navigation system)in Bangalore ... So searching was very easy on straight line. On intersections I would wait till I had better data.

Hope this helps,
BRM
 

Re: need help urgently

HI,
can you explain in detail how you done it .presntly iam going mad.help me
thanks &regards
 

Re: need help urgently

Is your issues solved.

Are you using linked lists at the end points?

You need to reload the data base based on the current heading ....
 

Re: need help urgently

Hi,

Two points about your problem:

1) You need to realize that you aren't going to be able to match the coordinates directly by comparison, unless you reduce the resolution of the data. Just chopping off digits isn't really very good because you could end up being quite far off. You probably want to know the distance between the points and then choose one that is less than some threshold. 1km, 100m, etc. (this will depend on your application)

2) Further to the "knowing the distance" problem... when you calculate distance on the earth, you must use a formula which takes the curvature into account. This is typically called "great circle distance" and is the shortest path between two points on the earth. Transcontinental airplane flight routes are often figured out this way.

I found this page which you might find helpful. It contains the formulas you need. Not surprisingly you need a little bit of trig. but even a small CPU should be able to do this without much effort.

https://en.wikipedia.org/wiki/Great-circle_distance
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…