#NEWLINE# def addorigin( self ) : #NEWLINE# #INDENT# ' Add origin to Motion Plan using canvas reference point.\n            The CoreLocation class maintains this reference point.\n        ' #NEWLINE# refgeo = self . session . location . refgeo #NEWLINE# origin = self . createElement ( 'origin' ) #NEWLINE# attrs = ( 'lat' , 'lon' , 'alt' ) #NEWLINE# have_origin = False #NEWLINE# for i in xrange ( 3 ) : #NEWLINE# #INDENT# if ( refgeo [ i ] is not None ) : #NEWLINE# #INDENT# origin . setAttribute ( attrs [ i ] , str ( refgeo [ i ] ) ) #NEWLINE# have_origin = True #NEWLINE# #UNINDENT# #UNINDENT# if ( not have_origin ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( self . session . location . refscale != 1.0 ) : #NEWLINE# #INDENT# origin . setAttribute ( 'scale100' , str ( self . session . location . refscale ) ) #NEWLINE# #UNINDENT# if ( self . session . location . refxyz != ( 0.0 , 0.0 , 0.0 ) ) : #NEWLINE# #INDENT# pt = self . createElement ( 'point' ) #NEWLINE# origin . appendChild ( pt ) #NEWLINE# ( x , y , z ) = self . session . location . refxyz #NEWLINE# coordstxt = ( '%s,%s' % ( x , y ) ) #NEWLINE# if z : #NEWLINE# #INDENT# coordstxt += ( ',%s' % z ) #NEWLINE# #UNINDENT# coords = self . createTextNode ( coordstxt ) #NEWLINE# pt . appendChild ( coords ) #NEWLINE# #UNINDENT# self . mp . appendChild ( origin )