describe('Metadata Storage', function() { this.timeout(120000); // 2 minutes for complex integration tests it('should execute test successfully', async function() { const { expect } = require('chai'); const SatLocProcessor = require('../../helpers/satloc_application_processor'); const path = require('path'); async function testMetadataStorage() { console.log('=== Testing UTM Metadata Storage ===\n'); const processor = new SatLocProcessor(); const logFilePath = path.join(__dirname, 'test-logs', 'Liquid_IF2_G4.log'); try { console.log('πŸ“ Processing file to test metadata storage...'); const result = await processor.parseSatLocLogFile(logFilePath); console.log('\nπŸ“Š Processing Results:'); console.log(`- Application Details: ${result.applicationDetails.length}`); console.log(`- Spray Segments: ${result.spraySegments.length}`); console.log('\nπŸ—ΊοΈ UTM Zone and Bounding Box Information:'); console.log(`- Reference UTM Zone: ${result.utmZone}`); console.log(`- Bounding Box: [${result.boundingBox.join(', ')}]`); const bbox = result.boundingBox; const width = bbox[2] - bbox[0]; // maxX - minX (longitude degrees) const height = bbox[3] - bbox[1]; // maxY - minY (latitude degrees) console.log(`- Coverage Area: ${(width * 111000).toFixed(0)}m Γ— ${(height * 111000).toFixed(0)}m (approx)`); // Verify that this metadata would be stored in ApplicationFile console.log('\nπŸ’Ύ ApplicationFile Meta (would be stored as):'); console.log(`- referenceUTMZone: "${result.utmZone}"`); console.log(`- boundingBox: [${result.boundingBox.join(', ')}]`); // Sample a few application details to verify UTM coordinates if (result.applicationDetails.length > 0) { console.log('\n🎯 Sample Application Detail Records:'); for (let i = 0; i < Math.min(3, result.applicationDetails.length); i++) { const detail = result.applicationDetails[i]; if (detail.utmX && detail.utmY) { console.log(`Record ${i + 1}: lat/lon (${detail.lat}, ${detail.lon}) β†’ UTM (${detail.utmX.toFixed(2)}, ${detail.utmY.toFixed(2)})`); } else { console.log(`Record ${i + 1}: UTM coordinates missing!`); } } } console.log('\nβœ… Metadata storage test completed successfully!'); } catch (error) { console.error('❌ Test failed:', error.message); } } testMetadataStorage(); }); });