Skip to content

Commit 05d28a2

Browse files
committed
Use title instead of identifier as the eodag migration
1 parent 475226a commit 05d28a2

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/imagery/i.sentinel/i.sentinel.coverage/i.sentinel.coverage.py

100644100755
+14-15
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,15 @@ def main():
258258
if resp[0] != b"":
259259
s_list = resp[0].decode("utf-8").strip().splitlines()
260260
else:
261+
# Experimental version warning needs to be removed from i.eodag
261262
if set(resp) == {b""}:
262263
grass.fatal(_("No products found"))
263264
else:
264265
error_msg = ""
265266
for i in range(0, len(resp)):
266267
error_msg += resp[i].decode("utf-8")
267268
grass.fatal(_("Error using i.sentinel.download: {}").format(error_msg))
268-
name_list_tmp = [x.split(" ")[1] for x in s_list]
269+
name_list_tmp = [x.split(" ")[0] for x in s_list]
269270
else:
270271
name_list_tmp = options["names"].split(",")
271272
name_list = []
@@ -279,13 +280,10 @@ def main():
279280
grass.run_command(
280281
"i.sentinel.download",
281282
settings=settings,
282-
map=area,
283-
start=start_day,
284-
end=end_day,
285283
footprints=fpi,
286284
producttype=producttype,
287-
query="identifier=%s" % name,
288-
flags="lb",
285+
id=name,
286+
flags="l",
289287
quiet=True,
290288
)
291289
name_list.append(name)
@@ -310,30 +308,31 @@ def main():
310308
grass.run_command(
311309
"v.db.update",
312310
map=temp_overlay,
313-
column="a_identifier",
314-
query_column='a_identifier || "+" ' + "|| b_identifier",
315-
where="a_identifier NOT NULL AND " + "b_identifier NOT NULL",
311+
column="a_title",
312+
query_column='a_title || "+" ' + "|| b_title",
313+
where="a_title NOT NULL AND " + "b_title NOT NULL",
316314
quiet=True,
317315
)
318316
grass.run_command(
319317
"v.db.update",
320318
map=temp_overlay,
321-
column="a_identifier",
322-
query_column="b_identifier",
323-
where="a_identifier IS NULL",
319+
column="a_title",
320+
query_column="b_title",
321+
where="a_title IS NULL",
324322
quiet=True,
325323
)
326324
grass.run_command(
327325
"v.db.renamecolumn",
328326
map=temp_overlay,
329-
column="a_identifier,identifier",
327+
column="a_title,title",
330328
quiet=True,
331329
)
332330
columns_dict = grass.parse_command("v.info", map=temp_overlay, flags="c")
333331
drop_columns = [
334332
col.split("|")[1]
335333
for col in columns_dict
336-
if col.split("|")[1] not in ["cat", "identifier"]
334+
if col.split("|")[1]
335+
not in ["cat", "title"] # What does cat refer to here?
337336
]
338337
grass.run_command(
339338
"v.db.dropcolumn", map=temp_overlay, columns=drop_columns, quiet=True
@@ -366,7 +365,7 @@ def main():
366365
# list of scenes that actually intersect with bbox
367366
name_list_updated_tmp = list(
368367
grass.parse_command(
369-
"v.db.select", map=fps_in_area, column="a_identifier", flags="c"
368+
"v.db.select", map=fps_in_area, column="a_title", flags="c"
370369
).keys()
371370
)
372371

0 commit comments

Comments
 (0)