Anyway, I think that the columns should have the same name and I suggest the following:
--- a/ost/s1/search.py
+++ b/ost/s1/search.py
@@ -153,16 +153,16 @@ def _query_scihub(opener, query):
# create empty GDF
columns = [
'identifier', 'polarisationmode', 'orbitdirection',
- 'acquisitiondate', 'relativeorbitnumber', 'orbitnumber',
- 'producttype', 'slicenumber', 'size', 'beginposition',
+ 'acquisitiondate', 'relativeorbit', 'orbitnumber',
+ 'product_type', 'slicenumber', 'size', 'beginposition',
'endposition', 'lastrelativeorbitnumber', 'lastorbitnumber',
'uuid', 'platformidentifier', 'missiondatatakeid',
'swathidentifier', 'ingestiondate', 'sensoroperationalmode',
- 'footprint'
+ 'geometry'
]
crs = {'init': 'epsg:4326'}
- geo_df = gpd.GeoDataFrame(columns=columns, crs=crs, geometry='footprint')
+ geo_df = gpd.GeoDataFrame(columns=columns, crs=crs)
# we need this for the paging
index, rows, next_page = 0, 99, 1
@@ -191,9 +191,7 @@ def _query_scihub(opener, query):
acq_list = _read_xml(dom)
- gdf = gpd.GeoDataFrame(
- acq_list, columns=columns, crs=crs, geometry='footprint'
- )
+ gdf = gpd.GeoDataFrame(acq_list, columns=columns, crs=crs)
# append the gdf to the full gdf
geo_df = geo_df.append(gdf)
@@ -335,9 +333,6 @@ def _to_postgis(gdf, db_connect, outtable):
# construct the SQL INSERT line
for _index, row in gdf.iterrows():
-
- row['geometry'] = dumps(row['footprint'])
- row.drop('footprint', inplace=True)
identifier = row.identifier
uuid = row.uuid
line = tuple(row.tolist())