def map_tuples(func, obj):
if obj['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>coordinates = tuple(func(obj['<STR_LIT>']))<EOL><DEDENT>elif obj['<STR_LIT:type>'] in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>coordinates = [tuple(func(c)) for c in obj['<STR_LIT>']]<EOL><DEDENT>elif obj['<STR_LIT:type>'] in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>coordinates = [[<EOL>tuple(func(c)) for c in curve]<EOL>for curve in obj['<STR_LIT>']]<EOL><DEDENT>elif obj['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>coordinates = [[[<EOL>tuple(func(c)) for c in curve]<EOL>for curve in part]<EOL>for part in obj['<STR_LIT>']]<EOL><DEDENT>elif obj['<STR_LIT:type>'] in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>return map_geometries(lambda g: map_tuples(func, g), obj)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % repr(obj))<EOL><DEDENT>return {'<STR_LIT:type>': obj['<STR_LIT:type>'], '<STR_LIT>': coordinates}<EOL>
Returns the mapped coordinates from a Geometry after applying the provided
function to each coordinate.

:param func: Function to apply to tuples
:type func: function
:param obj: A geometry or feature to extract the coordinates from.
:type obj: Point, LineString, MultiPoint, MultiLineString, Polygon,
MultiPolygon
:return: The result of applying the function to each dimension in the
array.
:rtype: list
:raises ValueError: if the provided object is not GeoJSON.