Feb-18-2019, 10:26 AM
Hi
First post for me so pls be gentle
There's a lot of pretext here for a fairly simple question but I thought it better to explain the context than just post a newbie question and invite a barrage of RTFM LMGTFY replies. I'm scoping for ways of doing a particular task, and Python is one of the options I have. This is what I need to do:
I have a small database of locations plus some other information fields which will look like
Lat,Long,Name,data1,data2 etc
and I expect to have 100-1000 order of magnitude number of records. When an event happens I need to iterate through the list as fast as possible and find the closest Lat/Long to my current lat/long then return the rest of the data associated with that record.
I'm planning to do this on a GPS module with embedded Python and this is the main reson for this post. Because as soon as I start searching for database/field/record etc I mostly get results about SQL plugins or suchlike which I doubt I will be able to use. Also, being embedded means resources will be pretty tight so what may work in PyCharm for example won't necessarily work for this platform.
What I think I need is to store my data in a list of dictionaries but I'd appreciate any [polite!] pointers or advice how to get started. Once I'm headed in the right direction I'm happy enough plugging away, RTFMing & Googling as I firmly believe doing is the best way of learning. (NB I'm a complete newbie to Python although I have dabbled in a fair few other languages over the years)
Thanks!
First post for me so pls be gentle

There's a lot of pretext here for a fairly simple question but I thought it better to explain the context than just post a newbie question and invite a barrage of RTFM LMGTFY replies. I'm scoping for ways of doing a particular task, and Python is one of the options I have. This is what I need to do:
I have a small database of locations plus some other information fields which will look like
Lat,Long,Name,data1,data2 etc
and I expect to have 100-1000 order of magnitude number of records. When an event happens I need to iterate through the list as fast as possible and find the closest Lat/Long to my current lat/long then return the rest of the data associated with that record.
I'm planning to do this on a GPS module with embedded Python and this is the main reson for this post. Because as soon as I start searching for database/field/record etc I mostly get results about SQL plugins or suchlike which I doubt I will be able to use. Also, being embedded means resources will be pretty tight so what may work in PyCharm for example won't necessarily work for this platform.
What I think I need is to store my data in a list of dictionaries but I'd appreciate any [polite!] pointers or advice how to get started. Once I'm headed in the right direction I'm happy enough plugging away, RTFMing & Googling as I firmly believe doing is the best way of learning. (NB I'm a complete newbie to Python although I have dabbled in a fair few other languages over the years)
Thanks!