Files
seisee/scripts/check_positions.py

23 lines
826 B
Python
Executable File

import json
data = json.load(open(r'F:\seismic_webapp\data\index.json'))
nodes_with_data = [n for n in data['nodes'].values() if n.get('dates') and len(n['dates']) > 0]
print(f'Nodes avec donnees: {len(nodes_with_data)}')
print('\n--- Nodes avec donnees et leurs positions ---')
for n in nodes_with_data[:10]:
pos = n.get('position')
has_pos = pos and pos.get('easting') and pos.get('northing')
print(f"Node {n['id']}: hasPos={has_pos}, pos={pos}")
print('\n--- Nodes avec donnees SANS position valide ---')
no_pos_count = 0
for n in nodes_with_data:
pos = n.get('position')
if not pos or not pos.get('easting') or not pos.get('northing'):
print(f"Node {n['id']}: pos={pos}")
no_pos_count += 1
print(f'\nTotal nodes sans position valide: {no_pos_count}')