Geopandas shapefile轴与实际图片的比例不同

问题描述 投票:0回答:1

我正在按照本教程,一切看起来都一样https://towardsdatascience.com/geopandas-101-plot-any-data-with-a-latitude-and-longitude-on-a-map-98e01944b972

那就是我得到要显示的地图,数据框看起来是相同的格式等等。但是,轴刻度很奇怪,达到+ 1M,这导致所有点都由(0,0)坐标向右渲染。有谁知道我做错了什么?它应该是一个普通的长/纬轴

这是我用于街道地图的代码:

street_map = gdp.read_file('/Users/mkjacks5/Documents/projects/Mobile data/data/geo/Maricopa_Street_Local_2013.shp')

这是剧情本身的代码

fig, ax = plt.subplots(figsize=(5,5))

street_map.plot(ax = ax,alpha = 0.4,color =“blue”)geo_df.plot(ax = ax,markersize = 50,color =“red”,marker =“^”,label =“Destination”)plt。图例(丙= { '尺寸':15})

我使用长编码坐标到点

crs =   {'init' :'epsg:4326'}

enter image description here

python plot geopandas
1个回答
0
投票

得到它使用

crs = from_string("+proj=longlat +datum=WGS84 +no_defs") 
street_map = street_map.to_crs(crs=crs) 
© www.soinside.com 2019 - 2024. All rights reserved.