{ "meta": { "version": "4.000.9103", "fileFormatVersion": "0.4", "date": "2024-12-02T20:22:22.554Z", "name": "folium-point", "description": "Simple demo with geopandas and folium", "groupName": "Python", "tags": [ { "text": "Python" }, { "text": "maps" }, { "text": "folium" } ], "schedulerLogOff": true }, "data": { "datanodes": [ { "name": "eiffel_tour", "type": "JSON_var_plugin", "settings": { "name": "eiffel_tour", "json_var": "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[2.2945,48.8584]},\"properties\":{\"name\":\"Eiffel Tower\",\"city\":\"Paris\"}}]}" } }, { "name": "map", "type": "Python_plugin", "settings": { "name": "map", "autoStart": true, "explicitTrig": false, "content": "import geopandas as gpd\nfrom shapely.geometry import shape\nimport folium\n\n\n# Read the GeoJSON file with GeoPandas\ngdf = gpd.GeoDataFrame.from_features(dataNodes[\"eiffel_tour\"][\"features\"])\n\n# Get the latitude and longitude of the Eiffel Tower\neiffel_tower = gdf.loc[0, \"geometry\"]\nlatitude, longitude = eiffel_tower.y, eiffel_tower.x\n\n# Create a folium map centered at the Eiffel Tower\nmap = folium.Map(location=[latitude, longitude], zoom_start=15)\n\n# Add a marker for the Eiffel Tower\nfolium.Marker(\n location=[latitude, longitude],\n popup=\"Eiffel Tower\",\n icon=folium.Icon(color=\"blue\", icon=\"info-sign\"),\n).add_to(map)\n\nreturn map._repr_html_()\n", "dockerImage": { "name": "Pyodide", "id": "__PYODIDE__" } } } ] }, "libraries": { "pyodideStandard": [ "geopandas" ], "pyodideMicropip": [ "folium" ] }, "dashboard": { "foliumMapsE": { "layout": { "top": 5, "left": 0, "height": 471, "width": 1024, "z-index": "1" }, "container": { "instanceId": "foliumMapsE", "modelJsonId": "foliumMaps" }, "modelParameters": { "backgroundColor": "rgba(0, 0, 0, 0)" }, "modelHiddenParams": { "map": "" } } }, "connections": { "foliumMapsE": { "_repr_html_": { "name": "_repr_html_", "dataNode": "map", "dataFields": [], "dataNodeIndex": 0 } } }, "display": { "theme": "default", "backgroundColor": "var(--widget-color-0)", "inheritThemeBackgroundColor": true, "marginX": 10, "marginY": 10, "width": 1294, "height": 590, "enforceHeightLimit": false }, "navBarNotification": false }