def geom_output(func, argtypes, offset=None):
 func.argtypes = argtypes
 if (not offset):
  func.restype = c_void_p
  func.errcheck = check_geom
 else:
  func.restype = c_int
  def geomerrcheck(result, func, cargs):
   return check_geom_offset(result, func, cargs, offset)
  func.errcheck = geomerrcheck
 return func

def geom_output ( func , argtypes , offset = None ) : func . argtypes = argtypes if ( not offset ) : func . restype = c_void_p func . errcheck = check_geom else : func . restype = c_int def geomerrcheck ( result , func , cargs ) : return check_geom_offset ( result , func , cargs , offset ) func . errcheck = geomerrcheck return func
for geos routines that return a geometry .