提问人:Tarak Pandya 提问时间:10/14/2023 最后编辑:BERATarak Pandya 更新时间:10/16/2023 访问量:65
如何使用 python folium、geopandas 和 pandas 从 csv 文件映射 Geojson 多边形的交互式绘图?
How to map interactive plot of Geojson polygons using python folium, geopandas and pandas from csv file?
问:
我正在尝试实现一个交互式地图(在 .html 文件中),该地图显示使用下面的 csv 中的此 geojson 列映射的多边形。我想合并 python 库,例如 pandas、geopandas 和 folium。输出应该是一个 html 文件,它允许地图的交互,当我们将鼠标悬停在多边形上时,机场、高度、unique_code和start_date就会出现。
这是示例 csv 文件(为了便于阅读,我按空格分隔每条记录):
unique_code,distinct_id,airport,geojson,height,start_date,end_date
ASD12356,2654935,YTZ,"{"type":"FeatureCollection","features":[{"geometry":{"coordinates":[[[-79.396249,43.629351],[-79.393073,43.627192],[-79.395562,43.624381],[-79.398395,43.626369],[-79.396249,43.629351]]],"type":"Polygon"},"type":"Feature","properties":{"MaxAltitude":"50","StartDateTime":"2023-05-18T11:00:11Z","airspaceClassCodes":["D"],"facility":"YTZ","ignoreMaps":false}}]}",50,5/18/2023 11:00,5/18/2023 13:30
ACF32659,9865321,YYZ,"{"type":"FeatureCollection","features":[{"geometry":{"coordinates":[[[-79.630513,43.684646],[-79.625399,43.681213],[-79.627544,43.678917],[-79.629433,43.680189],[-79.630513,43.684646]]],"type":"Polygon"},"type":"Feature","properties":{"MaxAltitude":"100","StartDateTime":"2023-05-20T08:00:09Z","airspaceClassCodes":["D"],"facility":"YYZ","ignoreMaps":false}}]}",100,5/20/2023 9:00,5/20/2023 9:30
ABG69543,6452654,YXU,"{"type":"FeatureCollection","features":[{"geometry":{"coordinates":[[[-81.145449,43.040584],[-81.144214,43.038541],[-81.150006,43.034278],[-81.156126,43.039133],[-81.145449,43.040584]]],"type":"Polygon"},"type":"Feature","properties":{"MaxAltitude":"80","StartDateTime":"2023-05-29T05:00:09Z","airspaceClassCodes":["D"],"facility":"YXU","ignoreMaps":false}}]}",80,5/29/2023 5:00,5/29/2023 7:30
先谢谢你!
答: 暂无答案
评论