aisdb.database.sql_query_strings module

aisdb.database.sql_query_strings.has_mmsi(*, alias, mmsi, **_)[source]

SQL callback selecting a single vessel identifier

Parameters:
  • alias (string) – the ‘alias’ in a ‘WITH tablename AS alias …’ SQL statement

  • mmsi (int) – vessel identifier

Returns:

SQL code (string)

aisdb.database.sql_query_strings.in_bbox(*, alias, xmin, xmax, ymin, ymax, **_)[source]

SQL callback restricting vessels in bounding box region

Parameters:
  • alias (string) – the ‘alias’ in a ‘WITH tablename AS alias …’ SQL statement

  • xmin (float) – minimum longitude

  • xmax (float) – maximum longitude

  • ymin (float) – minimum latitude

  • ymax (float) – maximum latitude

Returns:

SQL code (string)

aisdb.database.sql_query_strings.in_mmsi(*, alias, mmsis, **_)[source]

SQL callback selecting multiple vessel identifiers

Parameters:
  • alias (string) – the ‘alias’ in a ‘WITH tablename AS alias …’ SQL statement

  • mmsis (tuple) – tuple of vessel identifiers (int)

Returns:

SQL code (string)

aisdb.database.sql_query_strings.in_timerange(*, alias, start, end, **_)[source]

SQL callback restricting vessels in temporal range.

Parameters:
  • alias (string) – the ‘alias’ in a ‘WITH tablename AS alias …’ SQL statement

  • start (datetime) –

  • end (datetime) –

Returns:

SQL code (string)

aisdb.database.sql_query_strings.valid_mmsi(*, alias='m123', **_)[source]

SQL callback selecting all vessel identifiers within the valid vessel mmsi range, e.g. (201000000, 776000000)

Parameters:

alias (string) – the ‘alias’ in a ‘WITH tablename AS alias …’ SQL statement

Returns:

SQL code (string)