Create a new database DanishAIS
, then use your SQL editor to create the MobilityDB extension as follows:
CREATE EXTENSION MobilityDB CASCADE;
The CASCADE
command will additionally create the PostGIS extension.
Now create a table in which the CSV file will be loaded:
CREATE TABLE AISInput( T timestamp, TypeOfMobile varchar(50), MMSI integer, Latitude float, Longitude float, navigationalStatus varchar(50), ROT float, SOG float, COG float, Heading integer, IMO varchar(50), Callsign varchar(50), Name varchar(100), ShipType varchar(50), CargoType varchar(100), Width float, Length float, TypeOfPositionFixingDevice varchar(50), Draught float, Destination varchar(50), ETA varchar(50), DataSourceType varchar(50), SizeA float, SizeB float, SizeC float, SizeD float, Geom geometry(Point, 4326) );