Skip to content

Commit a493642

Browse files
arjxn-pyrdhyee
andauthored
fix examples/KML.ipynb because Recent versions of geopandas import fiona dynamically, and gpd.io.file.fiona is initially None. (#1258)
Co-authored-by: Raymond Yee <[email protected]>
1 parent 9a190ef commit a493642

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

examples/KML.ipynb

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"source": [
77
"You will need to install the below packages:\n",
88
"- `ipyleaflet`\n",
9-
"- `geopandas`"
9+
"- `geopandas`\n",
10+
"- `fiona`"
1011
]
1112
},
1213
{
@@ -16,8 +17,8 @@
1617
"outputs": [],
1718
"source": [
1819
"from ipyleaflet import Map, GeoData\n",
19-
"import geopandas\n",
20-
"import geodatasets as gpd"
20+
"import geopandas as gpd\n",
21+
"import fiona"
2122
]
2223
},
2324
{
@@ -30,7 +31,7 @@
3031
"\n",
3132
"m = Map(center=[41.8781, -87.6298], zoom=4)\n",
3233
"\n",
33-
"gpd.io.file.fiona.drvsupport.supported_drivers[\"KML\"] = \"rw\"\n",
34+
"fiona.drvsupport.supported_drivers[\"KML\"] = \"rw\"\n",
3435
"us_states = gpd.read_file(\"data/us-states.kml\", driver=\"KML\")\n",
3536
"\n",
3637
"geo_data = GeoData(\n",
@@ -48,11 +49,18 @@
4849
"m.add(geo_data)\n",
4950
"m"
5051
]
52+
},
53+
{
54+
"cell_type": "code",
55+
"execution_count": null,
56+
"metadata": {},
57+
"outputs": [],
58+
"source": []
5159
}
5260
],
5361
"metadata": {
5462
"kernelspec": {
55-
"display_name": "Python 3",
63+
"display_name": "Python 3 (ipykernel)",
5664
"language": "python",
5765
"name": "python3"
5866
},
@@ -66,7 +74,7 @@
6674
"name": "python",
6775
"nbconvert_exporter": "python",
6876
"pygments_lexer": "ipython3",
69-
"version": "3.7.6"
77+
"version": "3.11.12"
7078
}
7179
},
7280
"nbformat": 4,

0 commit comments

Comments
 (0)