Package aisutils :: Module database
[hide private]
[frames] | no frames]

Module database

source code

AIS database utilities.


Status: under development

Since: 2008 Jan 09

To Do:

See Also: WKT

Version: 8545

Date: 2008-02-06

Author: Kurt Schwehr

Contact: kurt at ccom.unh.edu

Copyright: 2008

License: GPL v2

Functions [hide private]
 
stdCmdlineOptions(parser, dbType='postgres', verbose=False)
Standard command line options
source code
 
createTables(cx, dbType='sqlite', includeList=None, excludeList=None, verbose=False) source code
 
dropTables(cx, includeList=None, excludeList=None, verbose=False)
Kiss your data goodbye
source code
 
connect(options, dbType=None)
options must include the above standard options
source code
 
rebuild_track_lines(cx, vessels=None, limitPoints=10, trackTable='track_lines', trackKey='ogc_fid', startTime=None, verbose=False) source code
 
rebuild_last_position(cx, vesselsClassA=None, vesselsClassB=None, lastPosTable='last_position', posKey='key', startTime=None, verbose=False)
This is to speed up the redrawing of the most recent position drawing in mapserver
source code
Variables [hide private]
  __revision__ = '8545'
  dbTypes = ('postgres', 'sqlite')
The choices of databases that are supported.
Function Details [hide private]

stdCmdlineOptions(parser, dbType='postgres', verbose=False)

source code 

Standard command line options

Parameters:
  • parser - OptionParser parser that will get the additional options
  • dbType - 'postgres' or 'sqlite'

createTables(cx, dbType='sqlite', includeList=None, excludeList=None, verbose=False)

source code 
Parameters:
  • cx (db API 2.0 object) - database connection
  • dbType (str) - postgres or sqlite
  • includeList (list of integers) - If a list of message numbers is passed, only these are created
  • excludeList (list of integers) - If a list of message numbers is passed, all but these are created

dropTables(cx, includeList=None, excludeList=None, verbose=False)

source code 

Kiss your data goodbye

Parameters:
  • cx (db API 2.0 object) - database connection
  • dbType (str) - postgres or sqlite
  • includeList (list of integers) - If a list of message numbers is passed, only these are created
  • excludeList (list of integers) - If a list of message numbers is passed, all but these are created

rebuild_track_lines(cx, vessels=None, limitPoints=10, trackTable='track_lines', trackKey='ogc_fid', startTime=None, verbose=False)

source code 
Parameters:
  • vessels - if None, do all vessels in the tables, otherwise a set of MMSI values
  • trackTable - the database table where to put the lines
  • limitPoints - max number of points in a track line
  • startTime (datetime) - oldest timestamp to allow in the track lines

rebuild_last_position(cx, vesselsClassA=None, vesselsClassB=None, lastPosTable='last_position', posKey='key', startTime=None, verbose=False)

source code 

This is to speed up the redrawing of the most recent position drawing in mapserver

Parameters:
  • vessels - if None, do all vessels in the tables, otherwise a set of MMSI values
  • trackTable - the database table where to put the lines
  • startTime (datetime) - oldest timestamp to allow in the last_position table