diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-04-11 18:06:10 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-04-11 18:06:10 +0000 |
commit | abe7bedcc09ebf2f8e2ce892006d92c94c4db03e (patch) | |
tree | 7c36212b9bee9a85acd75025b970eb9b9669da1a | |
parent | 4fc47737fd0a7a6d06e3ba076449c4f002272737 (diff) | |
download | navit-svn-abe7bedcc09ebf2f8e2ce892006d92c94c4db03e.tar.gz |
Fix:maptool:Provide reasonable timestamps, updated help to new namesrtm@3154
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@3154 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r-- | maptool/maptool.c | 11 | ||||
-rw-r--r-- | maptool/zip.c | 8 |
2 files changed, 13 insertions, 6 deletions
diff --git a/maptool/maptool.c b/maptool/maptool.c index 78ea95f2..59a93647 100644 --- a/maptool/maptool.c +++ b/maptool/maptool.c @@ -41,6 +41,7 @@ #include "config.h" #include "linguistics.h" #include "plugin.h" +#include "util.h" #include "maptool.h" long long slice_size=1024*1024*1024; @@ -107,9 +108,9 @@ usage(FILE *f) { /* DEVELOPPERS : don't forget to update the manpage if you modify theses options */ fprintf(f,"\n"); - fprintf(f,"osm2navit - parse osm textfile and converts to NavIt binfile format\n\n"); + fprintf(f,"maptool - parse osm textfile and converts to NavIt binfile format\n\n"); fprintf(f,"Usage :\n"); - fprintf(f,"bzcat planet.osm.bz2 | osm2navit mymap.bin\n"); + fprintf(f,"bzcat planet.osm.bz2 | maptool mymap.bin\n"); fprintf(f,"Available switches:\n"); fprintf(f,"-h (--help) : this screen\n"); fprintf(f,"-N (--nodes-only) : process only nodes\n"); @@ -169,6 +170,7 @@ int main(int argc, char **argv) main_init(argv[0]); struct zip_info zip_info; int suffix_start=0; + char *timestamp=current_to_iso8601(); while (1) { #if 0 @@ -468,7 +470,12 @@ int main(int argc, char **argv) if (start <= 4) { phase=3; if (i == suffix_start) { + int year,month,day,hour,min,sec; memset(&zip_info, 0, sizeof(zip_info)); + if (sscanf(timestamp,"%d-%d-%dT%d:%d:%d",&year,&month,&day,&hour,&min,&sec) == 6) { + zip_info.date=day | (month << 5) | ((year-1980) << 9); + zip_info.time=(sec >> 1) | (min << 5) | (hour << 11); + } } zipnum=zip_info.zipnum; fprintf(stderr,"PROGRESS: Phase 4: generating tiles %s\n",suffix); diff --git a/maptool/zip.c b/maptool/zip.c index b2331d8e..299910d0 100644 --- a/maptool/zip.c +++ b/maptool/zip.c @@ -61,8 +61,8 @@ write_zipmember(struct zip_info *zip_info, char *name, int filelen, char *data, 0x0a, 0x0, 0x0, - 0xbe2a, - 0x5d37, + zip_info->time, + zip_info->date, 0x0, 0x0, 0x0, @@ -77,8 +77,8 @@ write_zipmember(struct zip_info *zip_info, char *name, int filelen, char *data, 0x00, 0x0000, 0x0, - 0xbe2a, - 0x5d37, + zip_info->time, + zip_info->date, 0x0, 0x0, 0x0, |