diff --git a/osmconvert.c b/osmconvert.c index 2f99b77..9b83ddb 100644 --- a/osmconvert.c +++ b/osmconvert.c @@ -1,10 +1,10 @@ -// osmconvert 2017-06-18 21:30 -#define VERSION "0.8.8" +// osmconvert 2020-03-31 14:20 +#define VERSION "0.8.11" // // compile this file: // gcc osmconvert.c -lz -O3 -o osmconvert // -// (c) 2011..2017 Markus Weber, Nuernberg +// (c) 2011..2020 Markus Weber, Nuernberg // Richard Russo contributed the initiative to --add-bbox-tags option // // This program is free software; you can redistribute it and/or @@ -387,15 +387,15 @@ const char* helptext= "Tuning\n" "\n" "To speed-up the process, the program uses some main memory for a\n" -"hash table. By default, it uses 900 MB for storing a flag for every\n" -"possible node, 90 for the way flags, and 10 relation flags.\n" -"Every byte holds the flags for 8 ID numbers, i.e., in 900 MB the\n" -"program can store 7200 million flags. As there are less than 3200\n" -"million IDs for nodes at present (Oct 2014), 400 MB would suffice.\n" -"So, for example, you can decrease the hash sizes to e.g. 400, 50 and\n" -"2 MB using this option:\n" +"hash table. By default, it uses 1800 MB for storing a flag for every\n" +"possible node, 180 for the way flags, and 20 relation flags.\n" +"Every byte holds the flags for 8 ID numbers, i.e., in 1800 MB the\n" +"program can store 14400 million flags. As there are less than 7400\n" +"million IDs for nodes at present (Mar 2020), 925 MB would suffice.\n" +"So, for example, you can decrease the hash sizes to e.g. 1000, 120\n" +"and 4 MB using this option:\n" "\n" -" --hash-memory=400-50-2\n" +" --hash-memory=1000-120-4\n" "\n" "But keep in mind that the OSM database is continuously expanding. For\n" "this reason the program-own default value is higher than shown in the\n" @@ -404,10 +404,10 @@ const char* helptext= "amount of memory as a sum, and the program will divide it by itself.\n" "For example:\n" "\n" -" --hash-memory=1500\n" +" --hash-memory=3000\n" "\n" -"These 1500 MB will be split in three parts: 1350 for nodes, 135 for\n" -"ways, and 15 for relations.\n" +"These 3000 MB will be split in three parts: 2700 for nodes, 270 for\n" +"ways, and 30 for relations.\n" "\n" "Because we are taking hashes, it is not necessary to provide all the\n" "suggested memory; the program will operate with less hash memory too.\n" @@ -456,7 +456,7 @@ const char* helptext= "loss. Do not use the program in productive or commercial systems.\n" "\n" "There is NO WARRANTY, to the extent permitted by law.\n" -"Please send any bug reports to markus.weber@gmx.com\n\n"; +"Please send any bug reports to marqqs@gmx.eu\n\n"; #define _FILE_OFFSET_BITS 64 #include @@ -1621,7 +1621,7 @@ static int hash_ini(int n,int w,int r) { return 0; // ignore the call of this procedure // check parameters and store the values #define D(x,o) if(x<1) x= 1; else if(x>4000) x= 4000; \ - hash__max[o]= x*(1024*1024); + hash__max[o]= x*(1024u*1024u); D(n,0u) D(w,1u) D(r,2u) #undef D // allocate memory for each hash table @@ -11273,10 +11273,10 @@ return 23; keyp= key; valp= val; while(keyp @@ -479,6 +486,8 @@ static char global_tempfilename[350]= "osmfilter_tempfile"; static bool global_recursive= false; // recursive processing necessary static bool global_ignoredependencies= false; // user wants interobject dependencies to be ignored +static bool global_rawcomparison= false; + // user wants data to be compared on raw basis, not by numerical value #define PERR(f) { static int msgn= 3; if(--msgn>=0) \ fprintf(stderr,"osmfilter Error: " f "\n"); } // print error message @@ -892,7 +901,7 @@ static int hash_ini(int n,int w,int r) { return 0; // ignore the call of this procedure // check parameters and store the values #define D(x,o) if(x<1) x= 1; else if(x>4000) x= 4000; \ - hash__max[o]= x*(1024*1024); + hash__max[o]= x*(1024u*1024u); D(n,0) D(w,1) D(r,2) D(r,3) #undef D // allocate memory for each hash table @@ -2413,7 +2422,7 @@ static inline void fil_cpy(char *dest, const char *src, v= src; if(*v=='-') v++; // jump over sign - if(isdig(*v)) // numeric value + if(!global_rawcomparison && isdig(*v)) // numeric value op+= 8; dest[0]= op; fil__stresccpy(dest+1,src,len); // store this value @@ -3499,7 +3508,7 @@ static inline void modi_cpy(char *dest, const char *src, v= src; if(*v=='-') v++; // jump over sign - if(isdig(*v)) // numeric value + if(!global_rawcomparison && isdig(*v)) // numeric value op+= 8; dest[0]= op; modi__stresccpy(dest+1,src,len); // store this value @@ -6758,8 +6767,14 @@ return 0; continue; // take next parameter } if(strzcmp(a,"--ignore-dep")==0) { - // user does interobject dependencies to be ignored + // user wants interobject dependencies to be ignored global_ignoredependencies= true; + continue; // take next parameter + } + if(strzcmp(a,"--raw-comparison")==0) { + // user wants data to be compared on raw basis, + // not by numerical value + global_rawcomparison= true; continue; // take next parameter } if(strcmp(argv[0],"--in-josm")==0) { @@ -6967,7 +6982,9 @@ return 3; if(global_recursive) { int r; - if(h_n==0) h_n= 1000; // use standard value if not set otherwise + if(h_n==0) { // use standard values if not set otherwise + h_n= 1800; h_w= 180; h_r= 20; + } if(h_w==0 && h_r==0) { // user chose simple form for hash memory value // take the one given value as reference and determine the diff --git a/osmupdate.c b/osmupdate.c index d57e8b3..7a55fc5 100644 --- a/osmupdate.c +++ b/osmupdate.c @@ -1,10 +1,10 @@ -// osmupdate 2017-02-26 16:40 -#define VERSION "0.4.4" +// osmupdate 2018-05-27 12:00 +#define VERSION "0.4.5" // // compile this file: // gcc osmupdate.c -o osmupdate // -// (c) 2011..2017 Markus Weber, Nuernberg +// (c) 2011..2018 Markus Weber, Nuernberg // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU Affero General Public License @@ -111,9 +111,9 @@ const char* helptext= " changefiles in one run. This ability increases merging speed.\n" " Unfortunately, every changefile consumes about 200 MB of main\n" " memory while being processed. For this reason, the number of\n" -" parallely processable changefiles is limited.\n" +" parallelly processable changefiles is limited.\n" " Use this commandline argument to determine the maximum number\n" -" of parallely processed changefiles. The default value is 7.\n" +" of parallelly processed changefiles. The default value is 7.\n" "\n" "-t=TEMPPATH\n" "--tempfiles=TEMPPATH\n" @@ -165,7 +165,7 @@ const char* helptext= "loss. Do not use the program in productive or commercial systems.\n" "\n" "There is NO WARRANTY, to the extent permitted by law.\n" -"Please send any bug reports to markus.weber@gmx.com\n\n"; +"Please send any bug reports to marqqs@gmx.eu\n\n"; #define _FILE_OFFSET_BITS 64 #include @@ -511,7 +511,7 @@ static char global_osmconvert_arguments[2000]= ""; // general command line arguments for osmconvert; #define max_number_of_changefiles_in_cache 100 static int global_max_merge= 7; - // maximum number of parallely processed changefiles + // maximum number of parallelly processed changefiles static const char* global_gzip_parameters= ""; // parameters for gzip compression static char global_base_url[400]= @@ -1199,7 +1199,7 @@ return 0; continue; // take next parameter } if(strzcmp(a,"--max-merge=")==0) { - // maximum number of parallely processed changefiles + // maximum number of parallelly processed changefiles global_max_merge= strtouint32(a+12); if(global_max_merge<2) { global_max_merge= 2; @@ -1280,6 +1280,8 @@ return 0; return 1; } if(strcmp(a,"--complete-ways")==0 || + strcmp(a,"--complete-multipolygons")==0 || + strcmp(a,"--complete-boundaries")==0 || strcmp(a,"--complex-ways")==0 || strcmp(a,"--drop-brokenrefs")==0 || strcmp(a,"--drop-broken-refs")==0) {