You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Brian E. L. <br...@us...> - 2004-10-20 06:20:45
|
Update of /cvsroot/rideplot/rideplot/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27339 Modified Files: rideplot Log Message: Added image map file generation support when merging GPS data with digital photo exif data. Also added a transparent option Index: rideplot =================================================================== RCS file: /cvsroot/rideplot/rideplot/src/rideplot,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** rideplot 23 Aug 2004 18:23:45 -0000 1.9 --- rideplot 20 Oct 2004 06:20:36 -0000 1.10 *************** *** 66,70 **** $speed_cutoff $cutoff_count $brush_width $brush_color $output_file @waypoints $waypoint_file $waypoint_width $waypoint_fill $waypoint_name $waypoint_merge ! $photo_dir @photos @mapped_photos $photo_idx ); --- 66,70 ---- $speed_cutoff $cutoff_count $brush_width $brush_color $output_file @waypoints $waypoint_file $waypoint_width $waypoint_fill $waypoint_name $waypoint_merge ! $photo_dir @photos @mapped_photos $photo_idx $imap_file $transparent); *************** *** 375,378 **** --- 375,380 ---- "waypoint-name" => \$waypoint_name, # Print the Waypoints name. "photo-dir=s" => \$photo_dir, # Directory containing photos during tracking + "imap-file=s" => \$imap_file, # file to output image map to correspond to photo dots + "transparent" => \$transparent, # generate a transparent image for track "help" => sub { pod2usage({ -message => "\t\tRide Plot\n\t\t---------\n" , -exitval => 1 }); } , ); *************** *** 732,736 **** $black = $image->colorAllocate(0,0,0); $blue = $image->colorAllocate(0,0,255); ! $image->transparent($white); # Make white the transparent color if ( $use_color ) { --- 734,738 ---- $black = $image->colorAllocate(0,0,0); $blue = $image->colorAllocate(0,0,255); ! ($transparent) && $image->transparent($white); # Make white the transparent color if ( $use_color ) { *************** *** 833,836 **** --- 835,846 ---- } + ($debug) && print STDERR $imap_file,"\n"; + if ( defined $imap_file ) { + if ( !open ( IMAP_FILE, ">$imap_file" ) ) { + print STDERR "$0: unable to open IMap File " + ."imap_file for writing: $!\n"; + } + } + # Plot photo points here # @mapped_photos, [ $interplat, $interplon, $name ]; *************** *** 838,842 **** if ( $#mapped_photos > 0 ) { ! my $mapped_photo; foreach $mapped_photo (@mapped_photos) --- 848,853 ---- if ( $#mapped_photos > 0 ) { ! ! my $mapped_photo; foreach $mapped_photo (@mapped_photos) *************** *** 851,855 **** --- 862,871 ---- $image->arc( @rec_coords[0..1] ,6,6,0,360,$blue); + $image->fill( @rec_coords[0..1] ,$blue); + if ( defined $imap_file ) { + print IMAP_FILE "circle http://mapped_photo_url/#",${$mapped_photo}[2]," ", + join (",",@rec_coords[0..1]), " ",$rec_coords[0]+3 ,",",$rec_coords[1],"\n"; + } } *************** *** 1052,1055 **** --- 1068,1076 ---- file types are "gd2" (Linux Gardown 2) or "gd2d" (Same but degrees format ( -f 1)). + =item C<--imap-file="str"> + + When merging photos taken during collection of tracklog, this option will + generate an image map file that can be used with Apache's image map module + =item C<--output="str"> *************** *** 1084,1087 **** --- 1105,1113 ---- travelled. + =item C<--transparent> + + Generate image with transparent background. Works well when doing + an overlay. Otherwise, it uses a white background. + =item C<--brush-width=str> |
From: Brian E. L. <br...@us...> - 2004-08-23 18:23:57
|
Update of /cvsroot/rideplot/rideplot/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18084 Modified Files: rideplot Log Message: Updated rideplot help dialogue and renamed photo-dir option to match other options. Index: rideplot =================================================================== RCS file: /cvsroot/rideplot/rideplot/src/rideplot,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rideplot 22 Aug 2004 23:45:23 -0000 1.8 --- rideplot 23 Aug 2004 18:23:45 -0000 1.9 *************** *** 68,72 **** $photo_dir @photos @mapped_photos $photo_idx ); - $debug = 1; # convert degrees/min/sec to decimal degrees. --- 68,71 ---- *************** *** 271,274 **** --- 270,275 ---- # Syncronizes photos based upon prevtime and current timestr + # Accesses photo data based upon global information. + sub sync_photos { *************** *** 347,351 **** # handle command-line parameters ! $debug = 1; $use_color = 99; # Unset color variable $data_format = "gpstrans"; # gpstrans gd2 gardown gd2d --- 348,352 ---- # handle command-line parameters ! $debug = 0; $use_color = 99; # Unset color variable $data_format = "gpstrans"; # gpstrans gd2 gardown gd2d *************** *** 373,377 **** "waypoint-fill" => \$waypoint_fill, "waypoint-name" => \$waypoint_name, # Print the Waypoints name. ! "photo_dir=s" => \$photo_dir, # Directory containing photos during tracking "help" => sub { pod2usage({ -message => "\t\tRide Plot\n\t\t---------\n" , -exitval => 1 }); } , ); --- 374,378 ---- "waypoint-fill" => \$waypoint_fill, "waypoint-name" => \$waypoint_name, # Print the Waypoints name. ! "photo-dir=s" => \$photo_dir, # Directory containing photos during tracking "help" => sub { pod2usage({ -message => "\t\tRide Plot\n\t\t---------\n" , -exitval => 1 }); } , ); *************** *** 1017,1021 **** [ C<--max-width=int> ] [ C<--speed-cutoff=int> ] [ C<--brush-width=str> ] [ C<--brush-color=str> ] [ C<--waypoint-file=str> ] [ C<--waypoint-width=int> ] [ C<--waypoint-fill> ] [ C<--waypoint-name> ] ! [ C<--waypoint-merge> ] [ C<--help> ] [ C<--map-get=str>] [ C<--map-file=str>] =head1 DESCRIPTION --- 1018,1022 ---- [ C<--max-width=int> ] [ C<--speed-cutoff=int> ] [ C<--brush-width=str> ] [ C<--brush-color=str> ] [ C<--waypoint-file=str> ] [ C<--waypoint-width=int> ] [ C<--waypoint-fill> ] [ C<--waypoint-name> ] ! [ C<--waypoint-merge> ] [ C<--help> ] [ C<--map-get=str>] [ C<--map-file=str>] [ C<--photo-dir=str>] =head1 DESCRIPTION *************** *** 1141,1144 **** --- 1142,1150 ---- empty circles. + =item C<--photo-dir=str> + + Examines photos in this directory to determine if they were taken during the + tracklog data collection and plots a blue dot where each photo was taken + =item C<--help> |
From: Brian E. L. <br...@us...> - 2004-08-22 23:45:34
|
Update of /cvsroot/rideplot/rideplot/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16397 Modified Files: rideplot Log Message: Modified photo adjustment so it uses system TZ to adjust photo times to match GPS data. Index: rideplot =================================================================== RCS file: /cvsroot/rideplot/rideplot/src/rideplot,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rideplot 22 Aug 2004 22:19:27 -0000 1.7 --- rideplot 22 Aug 2004 23:45:23 -0000 1.8 *************** *** 50,54 **** # use GD; # Graphics library ! use POSIX qw( atan asin cos sin sqrt ); use Date::Calc qw( Delta_DHMS Decode_Date_US Decode_Month Add_Delta_DHMS ); use Getopt::Long; # Command line options --- 50,54 ---- # use GD; # Graphics library ! use POSIX qw( atan asin cos sin sqrt strftime); use Date::Calc qw( Delta_DHMS Decode_Date_US Decode_Month Add_Delta_DHMS ); use Getopt::Long; # Command line options *************** *** 226,230 **** sub get_photo_info { ! my $dir = shift; --- 226,232 ---- sub get_photo_info { ! my $strftime_offset = strftime "%z", localtime; ! my $tz_offset = ( $strftime_offset / 100.0 ) * (-1.0); ! my $dir = shift; *************** *** 253,260 **** # Photos have local timestamp. Change them to have GMT time ! # This is hard coded at the moment ! # The "-2" is the skew for the digital camera. ! my @ntime = Add_Delta_DHMS( @ltime, 0,7,-2,0); my $photo_timestr = sprintf ("%04d/%02d/%02d %02d:%02d:%02d" ,$ntime[0],$ntime[1],$ntime[2],$ntime[3],$ntime[4],$ntime[5]); --- 255,263 ---- # Photos have local timestamp. Change them to have GMT time ! # Get's the local timezone from the System or environment ! # The "-2" is the skew for the digital camera. Once again, this is hard coded and needs to ! # be changed. ! my @ntime = Add_Delta_DHMS( @ltime, 0,$tz_offset,-2,0); my $photo_timestr = sprintf ("%04d/%02d/%02d %02d:%02d:%02d" ,$ntime[0],$ntime[1],$ntime[2],$ntime[3],$ntime[4],$ntime[5]); |
From: Brian E. L. <br...@us...> - 2004-08-22 22:19:40
|
Update of /cvsroot/rideplot/rideplot/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22230 Modified Files: rideplot Log Message: Generates image with dots where photos were taken using --photo_dir option. I haven't documented this option yet. Some hard coded values exist for timestamp and some adjustment needed on image for dots. Index: rideplot =================================================================== RCS file: /cvsroot/rideplot/rideplot/src/rideplot,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rideplot 21 Aug 2004 08:17:07 -0000 1.6 --- rideplot 22 Aug 2004 22:19:27 -0000 1.7 *************** *** 60,64 **** use strict; use vars qw( $debug $deg $pi $km_per_mile $nonmetric $dist_m $x_scale $y_scale ! $image $max_x $max_y $white $black $dot_brush $dot_fg $dot_bg $scale @data $avg_lat $lat_scale $maxlat $minlat $maxlon $minlon $point $mb_scale $mid_lat $mid_lon $data_format $img_x $img_y $londist $latdist $map_url $map_file $map_get --- 60,64 ---- use strict; use vars qw( $debug $deg $pi $km_per_mile $nonmetric $dist_m $x_scale $y_scale ! $image $max_x $max_y $white $black $blue $dot_brush $dot_fg $dot_bg $scale @data $avg_lat $lat_scale $maxlat $minlat $maxlon $minlon $point $mb_scale $mid_lat $mid_lon $data_format $img_x $img_y $londist $latdist $map_url $map_file $map_get *************** *** 253,256 **** --- 253,257 ---- # Photos have local timestamp. Change them to have GMT time + # This is hard coded at the moment # The "-2" is the skew for the digital camera. *************** *** 259,263 **** my $photo_timestr = sprintf ("%04d/%02d/%02d %02d:%02d:%02d" ,$ntime[0],$ntime[1],$ntime[2],$ntime[3],$ntime[4],$ntime[5]); ! $debug && print "$file |",$photo_timestr, "|\n"; push @photos_tmp, [$photo_timestr , $file]; } --- 260,264 ---- my $photo_timestr = sprintf ("%04d/%02d/%02d %02d:%02d:%02d" ,$ntime[0],$ntime[1],$ntime[2],$ntime[3],$ntime[4],$ntime[5]); ! $debug && print STDERR "$file |",$photo_timestr, "|\n"; push @photos_tmp, [$photo_timestr , $file]; } *************** *** 266,269 **** --- 267,341 ---- } + # Syncronizes photos based upon prevtime and current timestr + sub sync_photos + { + my ($prevtime, $timestr, $prevlat, $prevlon, $lat, $lon) = @_; + # This subroutine is accessing global variables. And doesn't return anything. Should modularize this + + my $continue = 1; + + $debug && print STDERR "Continue: $continue. photo_idx $photo_idx \n"; + + while ( $photo_idx < $#photos && $continue == 1 ) + { + + my $time_photo = ${$photos[$photo_idx]}[0]; + my $photo_name = ${$photos[$photo_idx]}[1]; + + $debug && print STDERR "Prevtime: ", $prevtime ,"\n"; + $debug && print STDERR "Photo timestamp: ", $time_photo ,"\n"; + $debug && print STDERR "Timestr: ", $timestr ,"\n"; + + + + if ( $time_photo ge $prevtime && $time_photo lt $timestr ) + { + # We have a photo taken during tracklog collection. + + + # Interpolate the lat and lon for this photo based upon time + # prevtime, timestr, photo_time, prevlat, prevlon, lat, lon + my ($interplat, $interplon) = interpolate( $prevtime, $timestr, + ${$photos[$photo_idx]}[0], + $prevlat, $prevlon, + $lat, $lon); + push @mapped_photos, [ $interplat, $interplon, $photo_name ]; + + $photo_idx++; + + } + elsif ( $time_photo lt $prevtime ) + { + $photo_idx++; + + } + elsif ( $time_photo gt $timestr ) + { + $continue = 0; + } + else + { + $continue = 0; + } + + + $debug && print STDERR "Incremented on photo_idx: $photo_idx. Total: $#photos\n"; + + } + return; + } + + sub get_map + { + my $ua = LWP::UserAgent->new; + #$ua->agent('Mozilla/5.0'); # Set the user-agent. May not be needed. + $ua->env_proxy(); # Set Proxy settings from enviornment HTTP_PROXY or CGI_HTTP_PROXY + + print STDERR "Getting background map ..."; + my $request = HTTP::Request->new('GET', $map_url ); + my $response = $ua->request($request, $map_get ); + print STDERR " Done.\n"; + } + # initialize constants $pi = 4.0 * atan(1); *************** *** 542,595 **** if ( $#photos > 0 && $photo_idx < $#photos ) { ! my $continue = 1; ! ! $debug && print STDERR "Continue: $continue. photo_idx $photo_idx \n"; ! ! while ( $photo_idx < $#photos && $continue == 1 ) ! { ! ! my $time_photo = ${$photos[$photo_idx]}[0]; ! my $photo_name = ${$photos[$photo_idx]}[1]; ! ! $debug && print STDERR "Prevtime: ", $prevtime ,"\n"; ! $debug && print STDERR "Photo timestamp: ", $time_photo ,"\n"; ! $debug && print STDERR "Timestr: ", $timestr ,"\n"; ! ! ! ! if ( $time_photo ge $prevtime && $time_photo lt $timestr ) ! { ! # We have a photo taken during tracklog collection. ! ! ! # Interpolate the lat and lon for this photo based upon time ! # prevtime, timestr, photo_time, prevlat, prevlon, lat, lon ! my ($interplat, $interplon) = interpolate( $prevtime, $timestr, ! ${$photos[$photo_idx]}[0], ! $prevlat, $prevlon, ! $lat, $lon); ! push @mapped_photos, [ $interplat, $interplon, $photo_name ]; ! ! $photo_idx++; ! ! } ! elsif ( $time_photo lt $prevtime ) ! { ! $photo_idx++; ! ! } ! elsif ( $time_photo gt $timestr ) ! { ! $continue = 0; ! } ! else ! { ! $continue = 0; ! } ! ! ! $debug && print STDERR "Incremented on photo_idx: $photo_idx. Total: $#photos\n"; ! ! } } --- 614,618 ---- if ( $#photos > 0 && $photo_idx < $#photos ) { ! sync_photos($prevtime, $timestr, $prevlat, $prevlon, $lat, $lon); } *************** *** 677,680 **** --- 700,704 ---- die "$0: no travel at all in longitude - unable to scale\n"; } + # Get Center of map coords Needed for background map $mid_lat = ($maxlat + $minlat) / 2 ; *************** *** 695,699 **** # allocate the image and colors ! # I added 10 for picture dots $image = new GD::Image($max_x+$brush_width*2+2 , $max_y+$brush_width*2+2 ); # Store Image dimensions --- 719,723 ---- # allocate the image and colors ! $image = new GD::Image($max_x+$brush_width*2+2 , $max_y+$brush_width*2+2 ); # Store Image dimensions *************** *** 703,706 **** --- 727,731 ---- $white = $image->colorAllocate(255,255,255); # background $black = $image->colorAllocate(0,0,0); + $blue = $image->colorAllocate(0,0,255); $image->transparent($white); # Make white the transparent color *************** *** 810,823 **** { ! foreach (@mapped_photos) { $debug && print STDERR "Mapped photos\n"; ! $debug && print STDERR Dumper ( $_ ); # plot circle for each photo # The circlue is blue and is ten pixels in diameter for now. ! # my $blue = $image->colorAllocate(0,0,255); ! # $image->arc( ll2xy(@{$_}[0..1]) ,10,10,0,360,$blue); ! # $image->fill( ll2xy(@{$_}[0..1]) ,$blue); } --- 835,851 ---- { ! my $mapped_photo; ! foreach $mapped_photo (@mapped_photos) { $debug && print STDERR "Mapped photos\n"; ! $debug && print STDERR Dumper ( $mapped_photo ); ! my @rec_coords = ll2xy( @{$mapped_photo}[0..1], $maxlat, $minlat, $maxlon, $minlon, $max_x, $max_y ); ! $debug && print STDERR "Rec Coords are: ", join (" ",@rec_coords) , "\n"; # plot circle for each photo # The circlue is blue and is ten pixels in diameter for now. ! ! $image->arc( @rec_coords[0..1] ,6,6,0,360,$blue); ! $image->fill( @rec_coords[0..1] ,$blue); } *************** *** 941,955 **** #### - sub get_map - { - my $ua = LWP::UserAgent->new; - #$ua->agent('Mozilla/5.0'); # Set the user-agent. May not be needed. - $ua->env_proxy(); # Set Proxy settings from enviornment HTTP_PROXY or CGI_HTTP_PROXY - print STDERR "Getting background map ..."; - my $request = HTTP::Request->new('GET', $map_url ); - my $response = $ua->request($request, $map_get ); - print STDERR " Done.\n"; - } --- 969,973 ---- |
From: Brian E. L. <br...@us...> - 2004-08-21 08:17:21
|
Update of /cvsroot/rideplot/rideplot/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4686 Modified Files: rideplot Log Message: Creates plot data based upon photo timestamps. Doesn't quite plot yet. Index: rideplot =================================================================== RCS file: /cvsroot/rideplot/rideplot/src/rideplot,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rideplot 10 Sep 2002 12:15:39 -0000 1.5 --- rideplot 21 Aug 2004 08:17:07 -0000 1.6 *************** *** 51,67 **** use GD; # Graphics library use POSIX qw( atan asin cos sin sqrt ); ! use Date::Calc qw( Delta_DHMS Decode_Date_US Decode_Month ); use Getopt::Long; # Command line options use Pod::Usage; # Help uses the embedded POD documentation require LWP::UserAgent; # Http GET etc. use strict; use vars qw( $debug $deg $pi $km_per_mile $nonmetric $dist_m $x_scale $y_scale ! $image $max_x $max_y $white $black $dot_brush $dot_fg $dot_bg $scale ! @data $avg_lat $lat_scale $maxlat $minlat $maxlon $minlon $point $mb_scale ! $mid_lat $mid_lon $data_format $img_x $img_y $londist $latdist $map_url $map_file $map_get ! $maxspeed $use_color @sp_color @sp_brush $maxwidth $maxheight ! $speed_cutoff $cutoff_count $brush_width $brush_color $output_file ! @waypoints $waypoint_file $waypoint_width $waypoint_fill $waypoint_name $waypoint_merge ); # convert degrees/min/sec to decimal degrees. --- 51,72 ---- use GD; # Graphics library use POSIX qw( atan asin cos sin sqrt ); ! use Date::Calc qw( Delta_DHMS Decode_Date_US Decode_Month Add_Delta_DHMS ); use Getopt::Long; # Command line options use Pod::Usage; # Help uses the embedded POD documentation + use Image::EXIF; # Extracts EXIF information from photo require LWP::UserAgent; # Http GET etc. + use Data::Dumper; use strict; use vars qw( $debug $deg $pi $km_per_mile $nonmetric $dist_m $x_scale $y_scale ! $image $max_x $max_y $white $black $dot_brush $dot_fg $dot_bg $scale ! @data $avg_lat $lat_scale $maxlat $minlat $maxlon $minlon $point $mb_scale ! $mid_lat $mid_lon $data_format $img_x $img_y $londist $latdist $map_url $map_file $map_get ! $maxspeed $use_color @sp_color @sp_brush $maxwidth $maxheight ! $speed_cutoff $cutoff_count $brush_width $brush_color $output_file ! @waypoints $waypoint_file $waypoint_width $waypoint_fill $waypoint_name $waypoint_merge ! $photo_dir @photos @mapped_photos $photo_idx ); ! ! $debug = 1; # convert degrees/min/sec to decimal degrees. *************** *** 127,130 **** --- 132,164 ---- } + sub interpolate + { + my ($prevtime, $timestr, $photo_time, $prevlat, $prevlon, $lat, $lon) = @_; + + my ($interplat, $interplon); + # Do linear interpretation + + # Get total difference in seconds + + # compute time in seconds + my @ttime = Delta_DHMS( datetime2array( $prevtime ), + datetime2array( $timestr )); + my $tsec = $ttime[0]*86400 + $ttime[1]*3600 + $ttime[2]*60 + + $ttime[3]; + + # compute delta time in seconds + my @dtime = Delta_DHMS( datetime2array( $prevtime ), + datetime2array( $photo_time )); + my $dsec = $dtime[0]*86400 + $dtime[1]*3600 + $dtime[2]*60 + + $dtime[3]; + + $interplat = $prevlat + ( $lat - $prevlat ) * $dsec / $tsec; + + $interplon = $prevlon + ( $lon - $prevlon ) * $dsec / $tsec; + + + return ($interplat, $interplon); + } + # convert degrees to radians for trig functions sub deg2rad *************** *** 136,140 **** sub rad2deg { ! $_[0] * 180 / $pi; } --- 170,174 ---- sub rad2deg { ! $_[0] * 180.0 / $pi; } *************** *** 190,193 **** --- 224,269 ---- } + sub get_photo_info + { + + my $dir = shift; + + chdir( $dir ) or die "Failed to chdir: $!"; + + my $exif = new Image::EXIF; + + my @file_names = glob("dsc*.jpg"); + + my @photos_tmp; # list of photo information + + + my $file; + foreach $file (@file_names) + { + $debug && print STDERR "Get photo: $file\n"; + $exif->file_name($file); + my $image_info = $exif->get_image_info(); # hash reference + + my $str_buffer = $image_info->{"Image Created"}; + my ($date, $time) = split ' ', $str_buffer; + $date =~ s/:/\//g; + my $timestr = "$date $time"; + + my @ltime = datetime2array($timestr); + + # Photos have local timestamp. Change them to have GMT time + # The "-2" is the skew for the digital camera. + + my @ntime = Add_Delta_DHMS( @ltime, 0,7,-2,0); + + my $photo_timestr = sprintf ("%04d/%02d/%02d %02d:%02d:%02d" ,$ntime[0],$ntime[1],$ntime[2],$ntime[3],$ntime[4],$ntime[5]); + + $debug && print "$file |",$photo_timestr, "|\n"; + push @photos_tmp, [$photo_timestr , $file]; + } + + return @photos_tmp; + } + # initialize constants $pi = 4.0 * atan(1); *************** *** 196,200 **** # handle command-line parameters ! $debug = 0; $use_color = 99; # Unset color variable $data_format = "gpstrans"; # gpstrans gd2 gardown gd2d --- 272,276 ---- # handle command-line parameters ! $debug = 1; $use_color = 99; # Unset color variable $data_format = "gpstrans"; # gpstrans gd2 gardown gd2d *************** *** 222,225 **** --- 298,302 ---- "waypoint-fill" => \$waypoint_fill, "waypoint-name" => \$waypoint_name, # Print the Waypoints name. + "photo_dir=s" => \$photo_dir, # Directory containing photos during tracking "help" => sub { pod2usage({ -message => "\t\tRide Plot\n\t\t---------\n" , -exitval => 1 }); } , ); *************** *** 252,255 **** --- 329,335 ---- @data = (); + # initialize the mapped_photos array + @mapped_photos = (); + # initialize distance accumulator $dist_m = 0; *************** *** 266,269 **** --- 346,360 ---- $cutoff_count = 0; + # Initialize photo_idx variable + $photo_idx = 0; + + if ( $photo_dir ) + { + $debug && print STDERR "Photo Dir: $photo_dir\n"; + @photos = get_photo_info($photo_dir); + $debug && print STDERR "photo list\n"; + $debug && print STDERR Dumper( @photos) ; + } + # parse the track data # Note: though dates/times are included in the input, we assume all points are *************** *** 432,435 **** --- 523,527 ---- } + # Format yyyy/mm/dd 24hh:mm:ss $timestr = "$date $time"; # *************** *** 440,481 **** if ( defined $prevtime ) { - # the previous record is valid - compute dist/time/speed ! # compute distance in meters ! $ldist = dist ( $prevlat, $prevlon, ! $lat, $lon); ! # compute time in seconds ! @ltime = Delta_DHMS( datetime2array( $prevtime ), ! datetime2array( $timestr )); ! $lsec = $ltime[0]*86400 + $ltime[1]*3600 + $ltime[2]*60 + ! $ltime[3]; ! if ( $lsec == 0 ) { ! # multiple data points for same time point ! # avoid division by zero in speed by rejecting it ! # leave prev* variables alone ! next; ! } ! # compute speed in km/h ! # ( dist(m)/1000 ) / ( time(sec)/3600 ) ! # simplifies to ( dist(m) / time(sec)) * 3.6 ! $lspeed = ( $ldist / $lsec ) * 3.60; ! # check against speed cutoff for data filtering ! # (external units in kph or mph "nonmetric", internal units in km/h) ! if (( defined $speed_cutoff ) ! and $lspeed > $speed_cutoff ) { ! # speed is too high - we'll omit this data point ! # leave prev* variables alone ! $debug and printf STDERR "speed cutoff: " ! ."%6.2f meters in %d seconds: " ! ."%6.2f km/h / %6.2f mph\n", ! $ldist, $lsec, ! $lspeed, $lspeed/$km_per_mile; ! $cutoff_count++; ! next; } } else { # the previous entry is invalid - clear dist/time/speed --- 532,634 ---- if ( defined $prevtime ) { ! # the previous record is valid - compute dist/time/speed ! # Check if we have any photos left to check that were taken while ! # collecting tracklog data ! # Did we actually get a list and did we step through it? ! if ( $#photos > 0 && $photo_idx < $#photos ) ! { ! my $continue = 1; ! ! $debug && print STDERR "Continue: $continue. photo_idx $photo_idx \n"; ! ! while ( $photo_idx < $#photos && $continue == 1 ) { ! ! my $time_photo = ${$photos[$photo_idx]}[0]; ! my $photo_name = ${$photos[$photo_idx]}[1]; ! ! $debug && print STDERR "Prevtime: ", $prevtime ,"\n"; ! $debug && print STDERR "Photo timestamp: ", $time_photo ,"\n"; ! $debug && print STDERR "Timestr: ", $timestr ,"\n"; ! ! ! ! if ( $time_photo ge $prevtime && $time_photo lt $timestr ) ! { ! # We have a photo taken during tracklog collection. ! ! ! # Interpolate the lat and lon for this photo based upon time ! # prevtime, timestr, photo_time, prevlat, prevlon, lat, lon ! my ($interplat, $interplon) = interpolate( $prevtime, $timestr, ! ${$photos[$photo_idx]}[0], ! $prevlat, $prevlon, ! $lat, $lon); ! push @mapped_photos, [ $interplat, $interplon, $photo_name ]; ! ! $photo_idx++; ! ! } ! elsif ( $time_photo lt $prevtime ) ! { ! $photo_idx++; ! ! } ! elsif ( $time_photo gt $timestr ) ! { ! $continue = 0; ! } ! else ! { ! $continue = 0; ! } ! ! ! $debug && print STDERR "Incremented on photo_idx: $photo_idx. Total: $#photos\n"; ! } + } + + + # compute distance in meters + $ldist = dist ( $prevlat, $prevlon, + $lat, $lon); + + # compute time in seconds + @ltime = Delta_DHMS( datetime2array( $prevtime ), + datetime2array( $timestr )); + $lsec = $ltime[0]*86400 + $ltime[1]*3600 + $ltime[2]*60 + + $ltime[3]; + if ( $lsec == 0 ) { + # multiple data points for same time point + # avoid division by zero in speed by rejecting it + # leave prev* variables alone + next; + } + + # compute speed in km/h + # ( dist(m)/1000 ) / ( time(sec)/3600 ) + # simplifies to ( dist(m) / time(sec)) * 3.6 + $lspeed = ( $ldist / $lsec ) * 3.60; + + # check against speed cutoff for data filtering + # (external units in kph or mph "nonmetric", internal units in km/h) + if (( defined $speed_cutoff ) + and $lspeed > $speed_cutoff ) + { + # speed is too high - we'll omit this data point + # leave prev* variables alone + $debug and printf STDERR "speed cutoff: " + ."%6.2f meters in %d seconds: " + ."%6.2f km/h / %6.2f mph\n", + $ldist, $lsec, + $lspeed, $lspeed/$km_per_mile; + $cutoff_count++; + next; + } } else { # the previous entry is invalid - clear dist/time/speed *************** *** 542,546 **** # allocate the image and colors ! $image = new GD::Image($max_x+$brush_width*2+2, $max_y+$brush_width*2+2); # Store Image dimensions $img_x = ($max_x+$brush_width*2+2); --- 695,700 ---- # allocate the image and colors ! # I added 10 for picture dots ! $image = new GD::Image($max_x+$brush_width*2+2 , $max_y+$brush_width*2+2 ); # Store Image dimensions $img_x = ($max_x+$brush_width*2+2); *************** *** 650,653 **** --- 804,827 ---- } + # Plot photo points here + # @mapped_photos, [ $interplat, $interplon, $name ]; + + if ( $#mapped_photos > 0 ) + { + + foreach (@mapped_photos) + { + + $debug && print STDERR "Mapped photos\n"; + $debug && print STDERR Dumper ( $_ ); + # plot circle for each photo + # The circlue is blue and is ten pixels in diameter for now. + # my $blue = $image->colorAllocate(0,0,255); + # $image->arc( ll2xy(@{$_}[0..1]) ,10,10,0,360,$blue); + # $image->fill( ll2xy(@{$_}[0..1]) ,$blue); + + } + } + # Open the track file if it's defined. # Only write the track if were not merging the waypoints image. *************** *** 692,696 **** foreach $wp ( @waypoints ) { $wp_image->arc( ! ll2xy($wp->[2], $wp->[3], $maxlat, $minlat, $maxlon, $minlon, $max_x, $max_y ), --- 866,870 ---- foreach $wp ( @waypoints ) { $wp_image->arc( ! ll2xy($wp->[2], $wp->[3], $maxlat, $minlat, $maxlon, $minlon, $max_x, $max_y ), |
From: Simon G <sim...@us...> - 2002-09-10 12:15:43
|
Update of /cvsroot/rideplot/rideplot/src In directory usw-pr-cvs1:/tmp/cvs-serv13967 Modified Files: rideplot Log Message: New url for the Mapblast map. Can someone in the US test that the map lines up with a track. It works fine in Northern Europe :) Index: rideplot =================================================================== RCS file: /cvsroot/rideplot/rideplot/src/rideplot,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rideplot 7 Jun 2002 23:12:31 -0000 1.4 --- rideplot 10 Sep 2002 12:15:39 -0000 1.5 *************** *** 804,808 **** print STDERR "Scale $scale meters per pixel\n"; ! $map_url = "http://www.mapblast.com/gif?&CT=$mid_lat:$mid_lon:$mb_scale&IC=$mid_lat:$mid_lon:10&W=$img_x&H=$img_y&FAM=myblast&LB="; if ( defined $map_get ) { get_map(); --- 804,809 ---- print STDERR "Scale $scale meters per pixel\n"; ! # $map_url = "http://www.mapblast.com/gif?&CT=$mid_lat:$mid_lon:$mb_scale&IC=$mid_lat:$mid_lon:10&W=$img_x&H=$img_y&FAM=myblast&LB="; ! $map_url = "http://www.vicinity.com/gif?&CT=$mid_lat:$mid_lon:$mb_scale&IC=$mid_lat:$mid_lon:10&W=$img_x&H=$img_y&FAM=myblast&LB="; if ( defined $map_get ) { get_map(); |
From: Simon G <sim...@us...> - 2002-06-07 23:12:34
|
Update of /cvsroot/rideplot/rideplot/src In directory usw-pr-cvs1:/tmp/cvs-serv27489 Modified Files: rideplot Log Message: Fixed ?? Waypoint parsing for gpstrans format. /s/s+ instead of /t Tab isn't always true, especially after "cut and pastes" Index: rideplot =================================================================== RCS file: /cvsroot/rideplot/rideplot/src/rideplot,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rideplot 5 Jun 2002 07:34:04 -0000 1.3 --- rideplot 7 Jun 2002 23:12:31 -0000 1.4 *************** *** 293,297 **** if ( /^W\s+/ ) { my ( undef, $name, $comment, $date, $lat, $lon ) = ! split ( /\t/ ); $name =~ s/^\s*//o; $name =~ s/\s*$//o; --- 293,297 ---- if ( /^W\s+/ ) { my ( undef, $name, $comment, $date, $lat, $lon ) = ! split ( /\s\s+/ ); $name =~ s/^\s*//o; $name =~ s/\s*$//o; |
From: Simon G <sim...@us...> - 2002-06-05 07:34:08
|
Update of /cvsroot/rideplot/rideplot/src In directory usw-pr-cvs1:/tmp/cvs-serv14830 Modified Files: rideplot Log Message: New input Formats. Mapblast retrieval feature Waypoint name and merge with track features. See Comments at start of file for full list. Feedback required for the Mapblast feature. Does it work in the US Index: rideplot =================================================================== RCS file: /cvsroot/rideplot/rideplot/src/rideplot,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rideplot 14 Nov 2001 07:21:02 -0000 1.2 --- rideplot 5 Jun 2002 07:34:04 -0000 1.3 *************** *** 12,17 **** # For details about rideplot see http://rideplot.sourceforge.net/ # ! # This software converts track data downloaded via "gpstrans" from a ! # Garmin GPS into a PNG image which graphically represents the track # like a map. The resulting image may then be edited with GIMP or # another image editor to produce custom maps based on GPS-recorded --- 12,17 ---- # For details about rideplot see http://rideplot.sourceforge.net/ # ! # This software converts track and waypoint data downloaded from a [...988 lines suppressed...] + ie. HTTP_PROXY or CGI_HTTP_PROXY for cgi scripts. + + =item C<--map-file=str> + + Use the background map file. + + =item C<--waypoint-width=int> *************** *** 529,532 **** --- 944,951 ---- If selected, the waypoint circles will be filled in solid, rather than empty circles. + + =item C<--help> + + Display this Help information. =back |