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

Module grid

source code

Privide a class to allow laying ship tracks down into a grid.


Requires:

Author: Kurt Schwehr

Version: 8167

Status: under development

License: GPL v2

Since: 2007-Jul-29

To Do: allow for non-square grid cells

See Also: Tentative numpy tutorial

Date: 2008-01-09

Classes [hide private]
  Grid
Provide a grid data structure.
Functions [hide private]
 
distance(x1, y1, x2, y2) source code
 
distancePt(p1, p2) source code
 
almostEqual(a, b, epsilon=1e-06) source code
 
inRange(value, a, b) source code
 
inBoundingBox(x, y, x0, y0, x1, y1)
x,y in within or on the bounding box
source code
 
wktLine2list(track)
convert a well know text line to a list of points where each point is a tuple
source code
 
writeMultisegline2Gnuplot(outfile, multisegLine, name=None)
Convert a multisegment line data structure to gnuplot usable line
source code
 
writeMultiseglineWithCrossings2Gnuplot(outfile, multisegLine, name=None, field=3)
lens [((0, 0), 0.0, 0.24874371859296396, 0.99001249960545123), ((0, 1), 0.24874371859296396, 0.5, 1.0000126258640831), ((1, 2), 0.5, 0.75125628140703049, 1.0000126258640547), ((1, 3), 0.75125628140703049, 1.0, 0.99001249960547977)]
source code
Variables [hide private]
  gridTypes = ['occurrence', 'distance', 'distanceWeightedSpeed']
  e = 2.71828182846
  pi = 3.14159265359
Function Details [hide private]

wktLine2list(track)

source code 

convert a well know text line to a list of points where each point is a tuple

SELECT AsText(Transform(track,32619)) FROM tpath WHERE id=33;
>>> wktLine2list("LINESTRING(376596 4674402,378419 4668775,376569 4668059)")
[(376596.0, 4674402.0), (378419.0, 4668775.0), (376569.0, 4668059.0)]

writeMultiseglineWithCrossings2Gnuplot(outfile, multisegLine, name=None, field=3)

source code 
lens [((0, 0), 0.0, 0.24874371859296396, 0.99001249960545123), ((0, 1), 0.24874371859296396, 0.5, 1.0000126258640831), ((1, 2), 0.5, 0.75125628140703049, 1.0000126258640547), ((1, 3), 0.75125628140703049, 1.0, 0.99001249960547977)]
Parameters:
  • field - 1..3 where 3 is the distance, 1 and 2 are the fractions