The Vessel Tracker Application is a comprehensive tool designed to track and analyze vessel proximity data in real-time. The application connects to the AIS Stream API, logs vessel data, processes proximity logs, and provides an intuitive interface for users to search and analyze compiled proximity logs.
- Real-time Data Streaming: The application listens to AIS Stream API to fetch live vessel data.
- Daily Log Management:
- Creates a new daily CSV file with appropriate headers if one does not already exist.
- Appends incoming stream data to the current day's CSV file.
- At midnight (12:05 AM), processes the previous day's data and appends it to the compiled proximity logs.
- Proximity Detection: Calculates proximity between vessels based on geographic coordinates.
- Interpolation: Fills gaps in position data (greater than 5 minutes) with interpolated points for accurate proximity calculations.
- Search Functionality: Allows users to search logs by vessel name and date range.
- Cache Management: Periodically clears cache every 6 hours to prevent memory issues during extended runs.
- UI Features:
- Displays compiled logs in a table format.
- Allows users to generate logs and search for specific vessel information.
- Logs system messages and errors in a log display area.
- Connects to the AIS Stream API using WebSocket.
- Writes incoming data to a daily CSV file. If the file does not exist, it creates a new file with headers.
- At midnight (12:05 AM), the previous day's data is processed using proximity detection logic and appended to the compiled proximity logs.
- Detects when two vessels are within a defined proximity (e.g., 100 meters).
- Accounts for data gaps by interpolating missing data points when gaps exceed 5 minutes.
- Log Table: Displays compiled logs in a sortable table format.
- Search Bar: Filters logs by vessel name and date range.
- Log Display: Shows system messages and errors in real-time.
- Generate Logs Button: Allows manual compilation of logs from daily CSV files.
vessel_tracker/ │ ├── vessel_tracker_app.py # Main application file ├── requirements.txt # List of dependencies ├── compiled_proximity_logs.csv # Compiled logs (generated at runtime) ├── vessel_data_YYYY-MM-DD.csv # Daily logs (generated at runtime) └── README.md # This README file
-
Starting the software
- Enter the command
python vessel_tracker_app.py
or
python .\vessel_tracker_app.py
- in terminal under the program directory.
-
Streaming Data:
- The application begins streaming data upon launch.
- Ensure your API key is valid and network connectivity is available.
-
Search Logs:
- Enter a vessel name in the search bar.
- Select a date range and click the search button.
-
Generate Compiled Logs:
- Use the "Generate Compiled Logs" button to manually compile logs from existing daily files.
-
"Cannot queue arguments of type 'QTextCursor':
- Ensure the
log_messagemethod uses the signal-slot mechanism to update the UI.
- Ensure the
-
"No close frame received or sent":
- Check network connectivity or API key validity.
- The WebSocket listener retries the connection automatically.
-
"No daily log file found for [date]":
- Ensure data streaming was active on the specified date.
- Implement advanced analytics features for proximity trends.
- Add support for additional WebSocket message types.
- Enhance the UI with additional data visualization.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or issues, please contact me at darren.lim.off@gmail.com