#!/usr/bin/perl # # (C) Copyright 2001-2004 Diomidis Spinellis # # This file is part of GTWeb. # # GTWeb is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2, or (at your option) any later # version. # # GTWeb is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with groff; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # Scan a track log with appended location information (see program near) # and a set of image files # # Produce meta-information for the images # and a timeline # # $Id: timeline.pl 1.21 2004/02/07 08:35:19 dds Exp $ # # Local time offset # Set TZ EET-2 (winter) or (EST-3) summer use POSIX; use Time::Local; $starttime = time(); if ($#ARGV < 0 || $#ARGV > 1) { print STDERR "Usage: $0 track-log [picture-metadata]\n"; exit 1; } # Configuration variables $legdiff = 15 * 60; # After this long a new leg begins $partdist = 30000; # After so many meters a new part begins $stoptime = 5 * 60; # After this long we consider to have stopped $makemap = 1; # Set to true to re-create maps $makethumb = 1; # Set to true to re-create thumbs $mapinfo = 1; # Set to true to create hyperlinks to web maps $map_xsize = 640; $map_ysize = 480; $datpath = "$ENV{PROGDIR}/"; $plan9_map = 0; # Set 1 to use the Plan-9 map program instead of GMT $PI = 3.14159265358979; # Global variables $sec = 1; # Section number $mapnum = ''; # Map number $photonum = 0; undef($map_lasturl); init_arrays(); read_auxfiles(); read_track_log(); read_photos(); $overview = create_map(1e38, 1e38, 0, 0, "Trip Overview Map") . "
\n"; open(INDEX, ">index.html") || die; print INDEX htmlhead("Trip Log Presentation"); print INDEX '
';
print INDEX
"$sec. Trip Overview$overview"; $sec++; htmlpage('tdfeat.html', "Geographical Features and Photographs", create_timeline(1)); htmlpage('tafeat.html', "Geographical Features and Photographs", create_timeline(0)); print INDEX " $sec. Timelines$sec.1 Geographical features and photographs by date$sec.2 Geographical features and photographs (all, big - for searching) "; $sec++; htmlpage('legs.html', "Trip Legs", "Each leg represents a break of over " . time_form($legdiff) . ". \n" . create_map(1e38, $legdiff, 0, 1, "Trip Leg Map") . " \n"); htmlpage('parts.html', "Detailed Maps of Trip Parts", sprintf("Each part covers a linear distance of %d km. \n", $partdist / 1000) . # The map name is used to create photo back-links. Search for it. create_map($partdist, $legdiff, 1, 1, "Detailed Trip Part Map") . " \n"); print INDEX " $sec. Maps$sec.1 Overview$sec.2 Trip legs $sec.3 Detailed maps of trip parts "; $sec++; htmlpage('dphoto.html', "Photographs by Date", create_photos(1, 1)); htmlpage('allphoto.html', "All Photographs", create_photos(0, 1)); htmlpage('cphoto.html', "All Photographs", create_photos(0, 0)); print INDEX " $sec. Photographs$sec.1 Ordered by date$sec.2 All photographs $sec.3 Compact index (no captions) "; $sec++; print INDEX " $sec. Processing DetailsTrack log points processed: $#tracklogPhotos processed: $photonum Maps generated: $mapnum Local time setting: $ENV{TZ} Generated on: " . local_datetime(time()) . " Processing time: " . time_form(time() - $starttime) . ' Program version: $Id: timeline.pl 1.21 2004/02/07 08:35:19 dds Exp $ '; $sec++; print INDEX ' |
|