GPS Tracker / GEO Fence OF 500,000+ stored on device

Hi

I have a project where i have over 500,000 locations of co ordinates reflecting motor vehicle accidents over past 5 years.

The project is to create a gps tracker 3G sim and GPS Receiver that has the gps locations being determined every 2-3 seconds and have the co ordinates cross referenced against against the stored geo fences presenting vehicle accidents that occurred over past 5 yrs

As the reporting of geo-fences relevant to the current location of the vehicle needs to be performed in real time as the vehicle is driven i understand querying a table of 500,000+ geofences would not be possible if i am wanting real time notifications with no more than 2-4 second reporting lag

So my thought is that i need have a master table containing the 500,000+ records of geo fence co ordinates. I then have a subset of only 100 geo fences. The 100 geo fences would represent the 100 closest geo fences to the vehicle. As an example all geo fences records within 50 klm radius of the vehicle are extracted from the master database

EXAMPLE Car starts the current location of the vehicle is determined and then all the geo fences who co ordinate location are within 100 klm of the start location they are queried from the master table and stored in the subset table to a max of 100 records. As the device detects that the vehicle reaches a radius traveled of 95klm from the initial vehicle start location. the device will re run query to determine the closest 100 geo fences within 100 klm form the second location point. This is how the 100 record sub set will dynamically update automatically based on the travelling of the vehicle

QUESTION:

Is the above achievable using andrino or else some other platform. I suspect the biggest hurdles will be the size of the memory chip that needs to hold the 500,000+ records in perm memory and then the subset of 100 records stored in temporary memory

The reason for storage of the 500,000+ records locally is to avoid the need for having the data stored on a server and having to deal with data transfer of data from server to the device and the potential time lags that may occur. If all data is stored locally there no need to be reliant on the data transfer.

Please note i am a total novice yet to develop any form of electronic component project

As i am new to this type of development can you shed some light on the project life cycle what i mean is i assume the andrino is used as a proof of concept development solution.

Wondering if the proof of concept is proven how does one move from an andrino proof of concept to a solution that is to be produced for a commercial application.

I welcome all suggestion and advice

I suspect the biggest hurdles will be the size of the memory chip that needs to hold the 500,000+ records in perm memory

I would be using an SD card for that.

I'm not sure that I understand your project, though. As a driver, what use is the information that an accident, or 12 or 20 or 100, occurred near where I am, be to me?

Thanks for your prompt reply

Did not think about using an SD card

Taking your suggested approach are all the other functionality of using a subset possible for the viability of the project be achievable ?? The requirement of having thew sub set of data that the firmware uses to validate the actual co ordinates reported from the gps chip against the 100 records sub set in real time.

Thanks for your comment about clarification of the use of the data as a driver however i am not allowed to share that information re the end use application as its a part of a much bigger solution which i am not able to disclose

If you store the data on an SD card, in some sorted order, using fixed length records, finding the records that correspond to points that are within a square centered about a location is fast and easy.

In a circle, centered around a location is a bit more challenging, because you have to first determine if there are in the square and then whether they are in the circle, but not that difficult.

If the data is not sorted, or is not using fixed length records, you have to read the entire file, and examine every point.

The problem will come when you have identified that there are 2000 points within X distance of where I am. Or even 200. Storing 200 latitude and longitude values will take a lot of memory.

Fixed length records in the file means that you only need to store X number of record numbers. Still, with record numbers that exceed what will fit in an unsigned int means using 4 bytes per record number. 200 records means 800 bytes.

I see three major problems with your concept.

First, I don't think that the Arduino will be fast enough to provide real time data as I move around. If I were walking, sure. Driving? Maybe, maybe not.

Second, I don't know how you intend to show me where the accident locations are, nor do I see how I would use that information.

Third, since I am studying the GPS to see where I am, in unfamiliar territory, and your device (if it is separate) to see where accidents have occurred before, I'm not paying attention to my driving. So, I become another accident statistic for your database. How will you communicate changes to the database to other users of your system?

In general, what you want to do is possible. I can (or used to, anyway) buy a GPS from my local Harley dealer, and the locations of all the Harley dealers in the US are shown, overlaid on the standard map. The GPS I use now shows the locations of all the banks, restaurants, gas stations, etc. near me, and I'm relatively certain that there are more than 500,000 records in its database. I can connect my GPS to my computer, and update the database, any time the database maintainers learn about a new bank, a new restaurant, a new gas station, a new school etc., or when they learn about the closure of a bank, gas station, restaurant, etc.

Whether it is possible without the assistance of the major GPS manufacturers, or not, I do not know. With their help, of course, the project becomes almost trivial.

Hi

Thanks for your time you have taken to provide such a detailed response

The idea is to have a fully functional GPS Tracking unit with 3g Sim Card.

The sim card being used to transmit data to the tracking server for the gps location tracking as all gps tracking units perform this function.

The idea for the accident location points is to add using as you have suggested using a sd card for storage to report in real time that the driver is passing an accident point so each accident point geo fence would have a radius of 50 meters for example.

Each time a vehicle passes a point and they are doing so within 50 meters hence travelling into the fence zone this will trigger an output that may be audible and also send a packet event to the tracking server just as it does with normal fences

So in short i am wanting to end up with a fully functional gps tracking device that has the ability to store over 500,000 pre loaded geo fences and then using a subset of 100 fences to work with in rela time checking if the driver enters any of those 100 subset fences.