#NEWLINE# def __init__( self , type_input ) : #NEWLINE# #INDENT# 'Figures out the correct OGR Type based upon the input.' #NEWLINE# if isinstance ( type_input , OGRGeomType ) : #NEWLINE# #INDENT# num = type_input . num #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( type_input , basestring ) : #NEWLINE# #INDENT# type_input = type_input . lower ( ) #NEWLINE# if ( type_input == 'geometry' ) : #NEWLINE# #INDENT# type_input = 'unknown' #NEWLINE# #UNINDENT# num = self . _str_types . get ( type_input , None ) #NEWLINE# if ( num is None ) : #NEWLINE# #INDENT# raise OGRException ( ( 'Invalid OGR String Type "%s"' % type_input ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( type_input , int ) : #NEWLINE# #INDENT# if ( not ( type_input in self . _types ) ) : #NEWLINE# #INDENT# raise OGRException ( ( 'Invalid OGR Integer Type: %d' % type_input ) ) #NEWLINE# #UNINDENT# num = type_input #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( 'Invalid OGR input type given.' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . num = num