Replies: 8 comments 4 replies
-
Interesting concept and nice idea. Unfortunately, the distances are not available as database output as they are calculated in a different part of the code. So this is a nice solution with triggers and distance calc in the DB. I have not tested it, does it work well? You could make a table as well with only mmsi and record distance and not replicate the other fields? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Really nice! Love it and quite elegant. Not sure how efficient triggers are but better than saving all path data |
Beta Was this translation helpful? Give feedback.
-
Yes, that's true !! |
Beta Was this translation helpful? Give feedback.
-
I was toying with multiple ideas. You should definitely add this feature in any way possible. I'm pretty sure it will be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
-
I don't have enough traffic in my area to test ... performance wise. AIS-catcher is great! thanks so much for all the work done. My interest in Amateur radio just got a boost ...and the ships serve as range test buddies. |
Beta Was this translation helpful? Give feedback.
-
You don't actually need to divide by 1852 in the WHERE clause (you are just comparing numbers and it doesn't matter if they are in nautical miles or not) which might make a small performance improvement. |
Beta Was this translation helpful? Give feedback.
-
Hmm... |
Beta Was this translation helpful? Give feedback.
-
Hello ,
The idea was is to use a copy of database table ("ais_vessel") that for each ship/mmsi captures the last transmission.
If the ship is leaving, the last packet received if effectively the distance record for that ship.
If it's approaching, then further updates will lower this distance... i.e update ("record") only if last packet distance is lower than new packet .
I created a new table ("record") for this . ....... and insert/update rows only if distance of packet is greater.
A trigger function pushes any updates/insertions to the new table.
TriggerT.txt
I'm an absolute NEWbie in sql so any help/ideas/optimisation would be greatly appreciated.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions