Python-beginner here. I'm trying to fix a deprecation warning in:
df = gpd.GeoDataFrame(columns=['location', 'geometry'])
for dir, subdir, files in os.walk(StartDir):
for fname in files:
if fname.endswith(".tif"):
df = df.append({'location': fname, 'geometry': getBounds(os.path.join(dir+"/", fname))}, ignore_index=True)
by replacing the append line with:
df = gpd.pd.concat(df,{'location': fname, 'geometry': getBounds(os.path.join(dir+"/", fname))}, ignore_index=True)
which leads to this error message:
TypeError: first argument must be an iterable of pandas objects, you passed an object of type "GeoDataFrame"
What am I missing?
concatis expecting a list of (geo)dataframes as the first argument. See the docs about creating a GeoDataframe from your data. This GIS SE thread might also be useful. – Matt Oct 14 '22 at 23:48