Compare commits
No commits in common. "19dbe56dfbb808a9e4f3f22f20f9d3b6837187d6" and "c957406e777edf18a204f0d6f1287b448ed30ae1" have entirely different histories.
19dbe56dfb
...
c957406e77
10
ais_query.sh
10
ais_query.sh
@ -11,8 +11,8 @@ WEBSOCKET_URL="wss://stream.aisstream.io/v0/stream"
|
|||||||
# Default bounding box (worldwide coverage)
|
# Default bounding box (worldwide coverage)
|
||||||
# Format: [[lat1, lon1], [lat2, lon2]]
|
# Format: [[lat1, lon1], [lat2, lon2]]
|
||||||
# Current setting covers the entire world
|
# Current setting covers the entire world
|
||||||
BOUNDING_BOX='[[[-90,0],[5,60]]]'
|
#BOUNDING_BOX='[[[-90,0],[5,60]]]'
|
||||||
#BOUNDING_BOX='[[[-90, -180], [90, 180]]]'
|
BOUNDING_BOX='[[[-90, -180], [90, 180]]]'
|
||||||
|
|
||||||
# Optional: Filter by specific ship MMSI numbers (up to 50)
|
# Optional: Filter by specific ship MMSI numbers (up to 50)
|
||||||
# Leave empty for all ships
|
# Leave empty for all ships
|
||||||
@ -25,7 +25,7 @@ MESSAGE_TYPE_FILTER='["PositionReport"]'
|
|||||||
# Output file for logging (optional)
|
# Output file for logging (optional)
|
||||||
DateFichier=$(date +"%Y%m%d-%H%M%S")
|
DateFichier=$(date +"%Y%m%d-%H%M%S")
|
||||||
dir=$(dirname $0)
|
dir=$(dirname $0)
|
||||||
OUTPUT_FILE="$dir/data/raw_ais_$DateFichier.log"
|
OUTPUT_FILE="$dir/raw_ais_$DateFichier.log"
|
||||||
|
|
||||||
# Function to display usage information
|
# Function to display usage information
|
||||||
show_usage() {
|
show_usage() {
|
||||||
@ -165,7 +165,7 @@ echo "Message Types: $MESSAGE_TYPE_FILTER"
|
|||||||
if [ -n "$OUTPUT_FILE" ]; then
|
if [ -n "$OUTPUT_FILE" ]; then
|
||||||
echo "Output File: $OUTPUT_FILE"
|
echo "Output File: $OUTPUT_FILE"
|
||||||
# Create output file with timestamp header
|
# Create output file with timestamp header
|
||||||
#echo "# AIS Stream Data - $(date)" > "$OUTPUT_FILE"
|
echo "# AIS Stream Data - $(date)" > "$OUTPUT_FILE"
|
||||||
fi
|
fi
|
||||||
echo "Press Ctrl+C to stop..."
|
echo "Press Ctrl+C to stop..."
|
||||||
echo "----------------------------------------"
|
echo "----------------------------------------"
|
||||||
@ -184,4 +184,4 @@ trap cleanup EXIT INT TERM
|
|||||||
SUBSCRIPTION_MSG=$(create_subscription_message)
|
SUBSCRIPTION_MSG=$(create_subscription_message)
|
||||||
|
|
||||||
# Connect to websocket and send subscription message
|
# Connect to websocket and send subscription message
|
||||||
echo "$SUBSCRIPTION_MSG" | websocat -n --text - -H "Sec-WebSocket-Protocol: json" -v autoreconnect:"$WEBSOCKET_URL" | process_message
|
echo "$SUBSCRIPTION_MSG" | websocat -n -H "Sec-WebSocket-Protocol: json" -v "$WEBSOCKET_URL" - | process_message
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user