Geofences saved as Blobs

digiwize3 years ago

Hi Traccar/Anton

What a awesome experience I am have at using the Traccar platform. You guys are doing a great job with the Traccar platform.

I have implemeted/activated most of the functionality the Traccar platform presents and currently going through the geofence implementation.

I see that the geofences are saved as a 4096 varchar and it works nice for small geofence implementations.

Currently I select a route on Google maps and save the route as a gpx file. For long routes this gpx file can go into 100's of KB or event bigger.
Just thought that it might me worth it to save the GPX file as a BLOB inside the database instead of VARCHAR(4096). Unfortunately my JAVA is very rusted and I would have liked to contribute with some source code submissions, but I think it better for you Pros to implement this the correct way.

Also not sure what the preformance implications might be saving the geofence as a BLOB, but sure you will know better.

Maybe something you would consider for a next release/upgrade?..

Thanks guys.

Kind Regards
dirk van Deventer

Anton Tananaev3 years ago

Adding massive geofences will have a bad impact on performance. They are using on every location report, so you need to be very careful. That's one of the reasons we have a limit there.

digiwize3 years ago

Point take Anton.

I can imagine this could have a impact on performance, but for other tracking platforms this should have the same performance impact also.

Maybe it would be worth it to load the points in some kind of bubble/merge sorted hash map in memory to speed up performace, but im aware that the location needs to be resolved with something that might not be identical to the keys inside the hash map. If that make sense?!

All this might lead to more memory intensive hardware, but i would imagine it could be a necessity for some tracking platforms tracking hardware over thousand of kilometers.

Maybe give the platform administrator the option to either load the geoefences in varchar or a memory loaded/sorted map if configured via the config file

<entry key='geofence.hasmapstore'>true</entry>
Anton Tananaev3 years ago

Maybe it would be worth it to load the points in some kind of bubble/merge sorted hash map in memory to speed up performace, but im aware that the location needs to be resolved with something that might not be identical to the keys inside the hash map. If that make sense?!

Unfortunately it does not. We already store geofences it memory. That's not the problem. The problem is computation needed to determine if a point is inside a geofence. There are ways to create indexes for it. If you want to take on that task, that sounds good to me.

digiwize3 years ago

Perfect.

I will definately look into it and give some feedback.