code: def map_geometries(func, obj):
      """
      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.
      """
      simple_types = [
          "Point",
          "LineString",
          "MultiPoint",
          "MultiLineString",
          "Polygon",
          "MultiPolygon",
      ]
  
      if obj["type"] in simple_types:
          return func(obj)
      elif obj["type"] == "GeometryCollection":
          geoms = [
              func(geom) if geom else None for geom in obj["geometries"]
          ]
          return {"type": obj["type"], "geometries": geoms}
      elif obj["type"] == "Feature":
          obj["geometry"] = (
              func(obj["geometry"]) if obj["geometry"] else None
          )
          return obj
      elif obj["type"] == "FeatureCollection":
          feats = [
              map_geometries(func, feat) for feat in obj["features"]
          ]
          return {"type": obj["type"], "features": feats}
      else:
          raise ValueError("Invalid GeoJSON object %s" % repr(obj))
  
label_desc: Use image node_id 4 for calling a global function with example usage: map_geometries(func, obj) and returns: func, dict, obj, dict