Skip to content
Snippets Groups Projects
Commit 52e66b48 authored by pascal.mouquet_ird.fr's avatar pascal.mouquet_ird.fr
Browse files

Up tile db

parent 722187b7
No related branches found
No related tags found
No related merge requests found
......@@ -247,7 +247,7 @@ def fill_fields(
for field in field_names[7:]:
indice_count += tile_counts[tile_name][field.split("_")[0]]
if indice_count:
if datetime.datetime.now() - last_date_all_indices >= datetime.timedelta(5):
if datetime.datetime.now() - last_date_all_indices >= datetime.timedelta(6):
feat.SetField("color", colors[1])
else:
feat.SetField("color", colors[2])
......@@ -307,18 +307,24 @@ def full_db_2_shp(
total_index = list(set(total_index))
tile_count = {}
for key in total_index:
tile_count[key] = {
"l1c": len(
[k.name for k in lib._l1c_path.glob(key + "/*.SAFE")]
),
"l2a": len(
[k.name for k in lib._l2a_path.glob(key + "/*.SAFE")]
)}
logger.info(
"Searching Tile {} {}/{}".format(
key,
total_index.index(key)+1,
len(total_index),
)
)
n_l1c = len([k.name for k in lib._l1c_path.glob(key + "/*.SAFE")])
logger.info("L1C products: {}".format(n_l1c))
n_l2a = len([k.name for k in lib._l2a_path.glob(key + "/*.SAFE")])
logger.info("L2A products: {}".format(n_l2a))
tile_count[key] = {"l1c": n_l1c, "l2a": n_l2a}
for i in lib.indices:
pattern = ("{}/{}/S2*_MSI*_N*_R*_T*/*" + cm_string + ".jp2").format(i, key)
tile_count[key][i] = len(
[k.name for k in lib._indices_path.glob(pattern)]
)
logger.info("{} products: {}".format(i, tile_count[key][i]))
# Couche complète
query_str = "or ".join(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment