Using geodataframe #93
-
Greetings, I have a geodataframe. It is not clear to me how can I pass it to GeoGraph function to calculate landscape metrics gdf = ox.geometries.geometries_from_place('Manhattan', tags={'leisure': ['park','garden', 'dog_park'],'landuse': ['grass','allotments','flowerbed','village_green']}) Even when I pass a shapefile I am getting an error message test = GeoGraph('/Users/mohammadalattar/Downloads/Oo.shp') File "", line 1, in File "/Users/mohammadalattar/opt/anaconda3/lib/python3.8/site-packages/geograph/geograph.py", line 140, in init File "/Users/mohammadalattar/opt/anaconda3/lib/python3.8/site-packages/geograph/geograph.py", line 244, in _load_from_vector_path File "/Users/mohammadalattar/opt/anaconda3/lib/python3.8/site-packages/geograph/geograph.py", line 404, in _load_from_dataframe ValueError: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You need to make sure that |
Beta Was this translation helpful? Give feedback.
You need to make sure that
class_label
is a column in the dataframe indicating the landcover type, and that "geometry" is the column containing the geometries. This is necessary to ensure that GeoGraph can calculate landcover class level metrics.