0

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

Michael Delgado
  • 13,789
  • 3
  • 29
  • 54
  • what are you expecting? buffering creates a circle around points, and overlapping circles look like your image... can you describe more precisely why this is not what you're hoping to achieve? fwiw a buffer of 0.1 degrees is closer to 10 miles - if you simply use 0.01 do you get closer to what you're hoping for? – Michael Delgado Jun 27 '22 at 22:53
  • Thank you for answering. I am trying to create a buffer of 1mile and not 0.1 degrees. How do I make it so when I make a .buffer(1) it makes a 1mile or (1meter) buffer? I have tried different epsg but still unable. – code8848 Jun 27 '22 at 23:56
  • it looks like you're using [`set_crs(x)`](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.set_crs.html) (which tells geopandas that the CRS of the current data is x), and maybe what you want is [`to_crs`](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.to_crs.html)? – Michael Delgado Jun 28 '22 at 00:32
  • It gives the same result. – code8848 Jun 28 '22 at 00:55

2 Answers2

0

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).

Antoine B.
  • 56
  • 6
0

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