#NEWLINE# def geos_multipolygon_from_py( ob ) : #NEWLINE# #INDENT# 'ob must provide Python geo interface coordinates.' #NEWLINE# L = len ( ob ) #NEWLINE# assert ( L >= 1 ) #NEWLINE# N = len ( ob [ 0 ] [ 0 ] [ 0 ] ) #NEWLINE# assert ( ( N == 2 ) or ( N == 3 ) ) #NEWLINE# subs = ( c_void_p * L ) ( ) #NEWLINE# for l in range ( L ) : #NEWLINE# #INDENT# ( geom , ndims ) = polygon . geos_polygon_from_py ( ob [ l ] [ 0 ] , ob [ l ] [ 1 : ] ) #NEWLINE# subs [ l ] = cast ( geom , c_void_p ) #NEWLINE# #UNINDENT# return ( lgeos . GEOSGeom_createCollection ( 6 , subs , L ) , N )