#NEWLINE# def transform( self , coord_trans , clone = False ) : #NEWLINE# #INDENT# '\n        Transforms this geometry to a different spatial reference system.\n        May take a CoordTransform object, a SpatialReference object, string\n        WKT or PROJ.4, and/or an integer SRID.  By default nothing is returned\n        and the geometry is transformed in-place.  However, if the `clone`\n        keyword is set, then a transformed clone of this geometry will be\n        returned.\n        ' #NEWLINE# if clone : #NEWLINE# #INDENT# klone = self . clone ( ) #NEWLINE# klone . transform ( coord_trans ) #NEWLINE# return klone #NEWLINE# #UNINDENT# if isinstance ( coord_trans , CoordTransform ) : #NEWLINE# #INDENT# capi . geom_transform ( self . ptr , coord_trans . ptr ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( coord_trans , SpatialReference ) : #NEWLINE# #INDENT# capi . geom_transform_to ( self . ptr , coord_trans . ptr ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( coord_trans , ( six . integer_types + six . string_types ) ) : #NEWLINE# #INDENT# sr = SpatialReference ( self ) #NEWLINE# capi . geom_transform_to ( self . ptr , sr . ptr ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( 'Transform only accepts CoordTransform, SpatialReference, string, and integer objects.' )