Questions tagged «geopandas»

3
使用熊猫中的两个地理数据框获取最近的距离
这是我的第一个geodatframe: !pip install geopandas import pandas as pd import geopandas city1 = [{'City':"Buenos Aires","Country":"Argentina","Latitude":-34.58,"Longitude":-58.66}, {'City':"Brasilia","Country":"Brazil","Latitude":-15.78 ,"Longitude":-70.66}, {'City':"Santiago","Country":"Chile ","Latitude":-33.45 ,"Longitude":-70.66 }] city2 = [{'City':"Bogota","Country":"Colombia ","Latitude":4.60 ,"Longitude":-74.08}, {'City':"Caracas","Country":"Venezuela","Latitude":10.48 ,"Longitude":-66.86}] city1df = pd.DataFrame(city1) city2df = pd.DataFrame(city2) gcity1df = geopandas.GeoDataFrame( city1df, geometry=geopandas.points_from_xy(city1df.Longitude, city1df.Latitude)) gcity2df = geopandas.GeoDataFrame( city2df, geometry=geopandas.points_from_xy(city2df.Longitude, city2df.Latitude)) 城市1 City Country Latitude Longitude …

1
Geopandas ImportError:要在geopandas中绘制多边形,必须使用笛卡尔软件包
我正在尝试使用ANACONDA spyder运行一个简单的geopandas代码。但是,我遇到一个错误。 我已包含以下代码和错误: - 这是代码: import geopandas as gpd world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) world.plot() import matplotlib.pyplot as plt plt.show() - 这是错误: “在plot_polygon_collection中,文件” C:\ Users \ usr \ Anaconda3 \ lib \ site-packages \ geopandas \ plotting.py“,第90行,”在笛卡尔熊猫中绘制多边形需要笛卡尔软件包。“ ImportError:要在geopandas中绘制多边形,需要使用笛卡尔软件包。 - 我在网上检查过,但找不到针对此问题的故障排除解决方案。任何人都可以帮助和建议吗? 赞赏。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.