/** * Transform points array to GeoJSON FeatureCollection * @param {Array} points - Array of point objects from API * @returns {Object} GeoJSON FeatureCollection */ export function pointsToGeoJSON(points) { return { type: 'FeatureCollection', features: points.map(point => ({ type: 'Feature', geometry: { type: 'Point', coordinates: [point.longitude, point.latitude] }, properties: { id: point.id, timestamp: point.timestamp, altitude: point.altitude, battery: point.battery, accuracy: point.accuracy, velocity: point.velocity } })) } } /** * Format timestamp for display * @param {number} timestamp - Unix timestamp * @returns {string} Formatted date/time */ export function formatTimestamp(timestamp) { const date = new Date(timestamp * 1000) return date.toLocaleString('en-US', { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' }) }