1. Range detection
For every port you choose, you define a circle in nautical miles. AIS positions are scanned at regular intervals; a commercial vessel entering the circle creates a single detection event. A ship hovering at the edge does not trigger again.