Norwegian Kystverket publish AIS data for ship positions that can be used under NLOD license. This application stores the positions received and present current situation and history in a Map using Leaflet.
This demo is made using Python with Flask for the web server part, Leaflet/HTML for the presentation and SQLite for the database. AIS position data is read from a TCP connection continously using Python library pyais . The position updates are stored in a SQLite database using two tables: LastPositionReport and HistoricPosition. In addition a mapping table from mmsi to IMO data are imported into ImoVesselCodes table.