如何为每个点几何形状创建1英里的缓冲区并将其投影到地图上?

发布于 2025-02-11 02:44:46 字数 574 浏览 1 评论 0原文

每当我尝试创建缓冲区时,它都会覆盖整个区域,并看到一个大点。在这里,我试图在位于德克萨斯州特拉维斯县(奥斯汀)

gdf_2017 = gpd.GeoDataFrame(df_2017, geometry=gpd.points_from_xy(df_2017.longitude, 
df_2017.latitude))
gdf_2017 = gdf_2017.set_crs("EPSG:6588")
gdf_dem17 = gdf_dem17.set_crs("EPSG:6588")
gdf_2017.geometry=gdf_2017.geometry.buffer(0.1)

fig, ax = plt.subplots(figsize=(12,10))
gdf_dem17.plot(ax=ax)
gdf_2017.plot(ax=ax, color="red")

plt.show()

““ htttps://i.sstatic.net/kb1oc.png”此处

When ever I try to create buffer, it covers the whole area and a big dot is seen. Here, I am trying to make buffer on points which are located in Travis county, Texas (Austin)

gdf_2017 = gpd.GeoDataFrame(df_2017, geometry=gpd.points_from_xy(df_2017.longitude, 
df_2017.latitude))
gdf_2017 = gdf_2017.set_crs("EPSG:6588")
gdf_dem17 = gdf_dem17.set_crs("EPSG:6588")
gdf_2017.geometry=gdf_2017.geometry.buffer(0.1)

fig, ax = plt.subplots(figsize=(12,10))
gdf_dem17.plot(ax=ax)
gdf_2017.plot(ax=ax, color="red")

plt.show()

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘虞初梦 2025-02-18 02:44:46

您可以尝试通过crs ='epsg:4326' to points_from_xy,然后使用to_crs(“ epsg:6588”)在您的geodataframe上:

gdf_2017 = gpd.GeoDataFrame(df_2017, geometry=gpd.points_from_xy(df_2017.longitude, df_2017.latitude, crs='epsg:4326')).to_crs("EPSG:6588")

然后,由于EPSG:6588是一个2D笛卡尔坐标系统( buffer 方法将以米为单位起作用(6588 “ nofollow noreferrer”> https://epsg.io/6588 )。

you could try passing crs='epsg:4326' to points_from_xy and then using to_crs("EPSG:6588") on your GeoDataFrame :

gdf_2017 = gpd.GeoDataFrame(df_2017, geometry=gpd.points_from_xy(df_2017.longitude, df_2017.latitude, crs='epsg:4326')).to_crs("EPSG:6588")

Then, the buffer method will work in meters since EPSG:6588 is a 2D cartesian coordinates system (https://epsg.io/6588).

夜吻♂芭芘 2025-02-18 02:44:46

实际上,您的CR与缓冲区不同。缓冲区为仪表,但多边形的CRS是学位。将您的多边形几何形状更改为仪表。例如EPSG:32630

Actually, your CRS is not the same as your buffer . buffer is meter but your CRS of your polygons is degree. change your polygon geometry to meter. for example EPSG:32630

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文