#NEWLINE# def get_center( self ) : #NEWLINE# #INDENT# '\n        Get the center of the route.\n\n        Returns\n        -------\n        center: Location\n            latitude: latitude of center in degrees\n            longitude: longitude of center in degrees\n            elevation: not calculated here\n        ' #NEWLINE# if ( not self . points ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( not self . points ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# sum_lat = 0.0 #NEWLINE# sum_lon = 0.0 #NEWLINE# n = 0.0 #NEWLINE# for point in self . points : #NEWLINE# #INDENT# n += 1.0 #NEWLINE# sum_lat += point . latitude #NEWLINE# sum_lon += point . longitude #NEWLINE# #UNINDENT# if ( not n ) : #NEWLINE# #INDENT# return mod_geo . Location ( float ( 0 ) , float ( 0 ) ) #NEWLINE# #UNINDENT# return mod_geo . Location ( latitude = ( sum_lat / n ) , longitude = ( sum_lon / n ) )