Skip to content

Commit 55b1776

Browse files
committed
Fix Geopandas
1 parent e4d93dc commit 55b1776

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

pygeoapi_plugins/provider/geopandas_.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,8 @@ def create(self, item):
501501
if len(item) != len(self.gdf.columns):
502502
raise ProviderQueryError('Item to update does not match dataframe shape')
503503

504-
self.gdf = self.gdf._append(item, ignore_index=True)
504+
new_row = geopandas.GeoDataFrame([item], crs=self.gdf.crs)
505+
self.gdf = pandas.concat([self.gdf, new_row], ignore_index=True)
505506

506507
return self.gdf[self.id_field].iloc[-1]
507508

tests/test_geopandas_provider.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import datetime
3131

3232
import geopandas as gpd
33+
import pandas as pd
3334
import pytest
3435
import shapely
3536

@@ -284,7 +285,8 @@ def test_gpkg_sort_query(gpkg_config):
284285
'geometry': shapely.box(0, 0, 0, 0),
285286
}
286287

287-
p.gdf = p.gdf._append(dummy_row, ignore_index=True)
288+
new_row = gpd.GeoDataFrame([dummy_row], crs=p.gdf.crs)
289+
p.gdf = pd.concat([p.gdf, new_row], ignore_index=True)
288290
assert (len(p.gdf)) == 23
289291

290292
results = p.query(

0 commit comments

Comments
 (0)