in reply to Re^6: Calculate aircraft headings from GPS data for google kml display
in thread Calculate aircraft headings from GPS data for google kml display
I think this approach might work. Please note that this is just "shooting-from-the-hip" psuedo-code.
There are several way you can represent the row data in the array, but this should point you in the right direction.my %aircraft_ids; for my $row ( INPUT_ROWS ) { my ($row_id,$a_id,@row_fields) = split(',', $row); if ( exists( $aircraft)ids{$a_id} ) { my $prior_fields = $aircraft_ids{$a_id}; # do calcs here comparing current row data to priors } # and save these data points for the next time the ID is seen. $aircraft_ids{$a_id} = \@row_fields; }
|
|---|