Repository: python-visualization/folium

Issue:
map.get_bounds() fails for map with GeometryCollection
**Describe the bug**
If you add a GeoJson with a GeometryCollection to a Map, Map.get_bounds fails


**To Reproduce**

```
import folium

m = folium.Map(location=[39.949610, -75.150282], zoom_start=16)

geojson_data = {
    "geometries": [
        {
            "coordinates": [
                [
                    [-86.1570813, 39.7567006],
                    [-86.1570169, 39.7566965],
                    [-86.1570169, 39.7566429],
                    [-86.1566146, 39.7566181],
                    [-86.1566092, 39.7566676],
                    [-86.1565288, 39.7566965],
                    [-86.1567645, 39.7572846],
                    [-86.1568399, 39.7572821],
                    [-86.156904, 39.7574413],
                    [-86.1568345, 39.7574718],
                    [-86.1568131, 39.7585688],
                    [-86.1570223, 39.7585729],
                    [-86.1570227, 39.7585614],
                    [-86.1570809, 39.7567123],
                    [-86.1570813, 39.7567006],
                ]
            ],
            "type": "Polygon",
        },
    ],
    "type": "GeometryCollection",
}
folium.GeoJson(geojson_data).add_to(m)

m.get_bounds()
```

**Expected behavior**
I expected this to return a list of two points

**Environment (please complete the following information):**
 - Browser [e.g. chrome, firefox]
 - Jupyter Notebook or html files?
 - Python version (check it with `import sys; print(sys.version_info)`)
 sys.version_info(major=3, minor=9, micro=11, releaselevel='final', serial=0)
 - folium version (check it with `import folium; print(folium.__version__)`)
 0.12.1.post1
 - branca version (check it with `import branca; print(branca.__version__)`)
 0.5.0

**Additional context**
Add any other context about the problem here.

**Possible solutions**
List any solutions you may have come up with.

folium is maintained by volunteers. Can you help making a fix for this issue?


Discussion:

Patch:
diff --git a/folium/folium.py b/folium/folium.py
index 11179be4..6dad4bb4 100644
--- a/folium/folium.py
+++ b/folium/folium.py
@@ -42,7 +42,7 @@ _default_css = [
     ('bootstrap_theme_css',
      'https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css'),  # noqa
     ('awesome_markers_font_css',
-     'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/all.min.css'),  # noqa
+     'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css'),  # noqa
     ('awesome_markers_css',
      'https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css'),  # noqa
     ('awesome_rotate_css',
diff --git a/folium/utilities.py b/folium/utilities.py
index 875ac015..62f5869f 100644
--- a/folium/utilities.py
+++ b/folium/utilities.py
@@ -331,6 +331,8 @@ def iter_coords(obj):
         coords = [geom['geometry']['coordinates'] for geom in obj['features']]
     elif 'geometry' in obj:
         coords = obj['geometry']['coordinates']
+    elif 'geometries' in obj and 'coordinates' in obj['geometries'][0]:
+        coords = obj['geometries'][0]['coordinates']
     else:
         coords = obj.get('coordinates', obj)
     for coord in coords:


Test patch:
diff --git a/tests/test_features.py b/tests/test_features.py
index f2f0611a..b0171640 100644
--- a/tests/test_features.py
+++ b/tests/test_features.py
@@ -314,3 +314,24 @@ def test_geojson_find_identifier():
     geojson.convert_to_feature_collection()
     assert geojson.find_identifier() == 'feature.id'
     assert geojson.data['features'][0]['id'] == '0'
+
+
+def test_geometry_collection_get_bounds():
+    """Assert #1599 is fixed"""
+    geojson_data = {
+        "geometries": [
+            {
+                "coordinates": [
+                    [
+                        [-1, 1],
+                        [0, 2],
+                        [-3, 4],
+                        [2, 0],
+                    ]
+                ],
+                "type": "Polygon",
+            },
+        ],
+        "type": "GeometryCollection",
+    }
+    assert folium.GeoJson(geojson_data).get_bounds() == [[0, -3], [4, 2]]