def map_geometries(func, obj):
simple_types = [<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>]<EOL>if obj['<STR_LIT:type>'] in simple_types:<EOL><INDENT>return func(obj)<EOL><DEDENT>elif obj['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>geoms = [func(geom) if geom else None for geom in obj['<STR_LIT>']]<EOL>return {'<STR_LIT:type>': obj['<STR_LIT:type>'], '<STR_LIT>': geoms}<EOL><DEDENT>elif obj['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>geom = func(obj['<STR_LIT>']) if obj['<STR_LIT>'] else None<EOL>return {<EOL>'<STR_LIT:type>': obj['<STR_LIT:type>'],<EOL>'<STR_LIT>': geom,<EOL>'<STR_LIT>': obj['<STR_LIT>'],<EOL>}<EOL><DEDENT>elif obj['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>feats = [map_geometries(func, feat) for feat in obj['<STR_LIT>']]<EOL>return {'<STR_LIT:type>': obj['<STR_LIT:type>'], '<STR_LIT>': feats}<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % repr(obj))<EOL><DEDENT>
Returns the result of passing every geometry in the given geojson object
through func.

:param func: Function to apply to tuples
:type func: function
:param obj: A geometry or feature to extract the coordinates from.
:type obj: GeoJSON
:return: The result of applying the function to each geometry
:rtype: list
:raises ValueError: if the provided object is not geojson.