Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/src/planetsplitter.c
Parent Directory
|
Revision Log
Revision 1680 -
(show annotations)
(download)
(as text)
Tue May 26 17:28:56 2015 UTC (9 years, 9 months ago) by amb
File MIME type: text/x-csrc
File size: 22277 byte(s)
Tue May 26 17:28:56 2015 UTC (9 years, 9 months ago) by amb
File MIME type: text/x-csrc
File size: 22277 byte(s)
Merge branch 'MSVC' back into the trunk.
1 | /*************************************** |
2 | OSM planet file splitter. |
3 | |
4 | Part of the Routino routing software. |
5 | ******************/ /****************** |
6 | This file Copyright 2008-2015 Andrew M. Bishop |
7 | |
8 | This program is free software: you can redistribute it and/or modify |
9 | it under the terms of the GNU Affero General Public License as published by |
10 | the Free Software Foundation, either version 3 of the License, or |
11 | (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public License |
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | ***************************************/ |
21 | |
22 | |
23 | #include <stdio.h> |
24 | #include <stdlib.h> |
25 | #include <string.h> |
26 | #include <errno.h> |
27 | |
28 | #include "types.h" |
29 | #include "ways.h" |
30 | |
31 | #include "typesx.h" |
32 | #include "nodesx.h" |
33 | #include "segmentsx.h" |
34 | #include "waysx.h" |
35 | #include "relationsx.h" |
36 | #include "superx.h" |
37 | #include "prunex.h" |
38 | |
39 | #include "files.h" |
40 | #include "logging.h" |
41 | #include "errorlogx.h" |
42 | #include "functions.h" |
43 | #include "osmparser.h" |
44 | #include "tagging.h" |
45 | #include "uncompress.h" |
46 | |
47 | |
48 | /* Global variables */ |
49 | |
50 | /*+ The name of the temporary directory. +*/ |
51 | char *option_tmpdirname=NULL; |
52 | |
53 | /*+ The amount of RAM to use for filesorting. +*/ |
54 | size_t option_filesort_ramsize=0; |
55 | |
56 | /*+ The number of threads to use for filesorting. +*/ |
57 | int option_filesort_threads=1; |
58 | |
59 | |
60 | /* Local functions */ |
61 | |
62 | static void print_usage(int detail,const char *argerr,const char *err); |
63 | |
64 | |
65 | /*++++++++++++++++++++++++++++++++++++++ |
66 | The main program for the planetsplitter. |
67 | ++++++++++++++++++++++++++++++++++++++*/ |
68 | |
69 | int main(int argc,char** argv) |
70 | { |
71 | NodesX *OSMNodes; |
72 | SegmentsX *OSMSegments,*SuperSegments=NULL,*MergedSegments=NULL; |
73 | WaysX *OSMWays; |
74 | RelationsX *OSMRelations; |
75 | int iteration=0,quit=0; |
76 | int max_iterations=5; |
77 | char *dirname=NULL,*prefix=NULL,*tagging=NULL,*errorlog=NULL; |
78 | int option_parse_only=0,option_process_only=0; |
79 | int option_append=0,option_keep=0,option_changes=0; |
80 | int option_filenames=0; |
81 | int option_prune_isolated=500,option_prune_short=5,option_prune_straight=3; |
82 | int arg; |
83 | |
84 | printf_program_start(); |
85 | |
86 | /* Parse the command line arguments */ |
87 | |
88 | for(arg=1;arg<argc;arg++) |
89 | { |
90 | if(!strcmp(argv[arg],"--help")) |
91 | print_usage(1,NULL,NULL); |
92 | else if(!strncmp(argv[arg],"--dir=",6)) |
93 | dirname=&argv[arg][6]; |
94 | else if(!strncmp(argv[arg],"--prefix=",9)) |
95 | prefix=&argv[arg][9]; |
96 | else if(!strncmp(argv[arg],"--sort-ram-size=",16)) |
97 | option_filesort_ramsize=atoi(&argv[arg][16]); |
98 | #if defined(USE_PTHREADS) && USE_PTHREADS |
99 | else if(!strncmp(argv[arg],"--sort-threads=",15)) |
100 | option_filesort_threads=atoi(&argv[arg][15]); |
101 | #endif |
102 | else if(!strncmp(argv[arg],"--tmpdir=",9)) |
103 | option_tmpdirname=&argv[arg][9]; |
104 | else if(!strncmp(argv[arg],"--tagging=",10)) |
105 | tagging=&argv[arg][10]; |
106 | else if(!strcmp(argv[arg],"--loggable")) |
107 | option_loggable=1; |
108 | else if(!strcmp(argv[arg],"--logtime")) |
109 | option_logtime=1; |
110 | else if(!strcmp(argv[arg],"--logmemory")) |
111 | option_logmemory=1; |
112 | else if(!strcmp(argv[arg],"--errorlog")) |
113 | errorlog="error.log"; |
114 | else if(!strncmp(argv[arg],"--errorlog=",11)) |
115 | errorlog=&argv[arg][11]; |
116 | else if(!strcmp(argv[arg],"--parse-only")) |
117 | option_parse_only=1; |
118 | else if(!strcmp(argv[arg],"--process-only")) |
119 | option_process_only=1; |
120 | else if(!strcmp(argv[arg],"--append")) |
121 | option_append=1; |
122 | else if(!strcmp(argv[arg],"--keep")) |
123 | option_keep=1; |
124 | else if(!strcmp(argv[arg],"--changes")) |
125 | option_changes=1; |
126 | else if(!strncmp(argv[arg],"--max-iterations=",17)) |
127 | max_iterations=atoi(&argv[arg][17]); |
128 | else if(!strncmp(argv[arg],"--prune",7)) |
129 | { |
130 | if(!strcmp(&argv[arg][7],"-none")) |
131 | option_prune_isolated=option_prune_short=option_prune_straight=0; |
132 | else if(!strncmp(&argv[arg][7],"-isolated=",10)) |
133 | option_prune_isolated=atoi(&argv[arg][17]); |
134 | else if(!strncmp(&argv[arg][7],"-short=",7)) |
135 | option_prune_short=atoi(&argv[arg][14]); |
136 | else if(!strncmp(&argv[arg][7],"-straight=",10)) |
137 | option_prune_straight=atoi(&argv[arg][17]); |
138 | else |
139 | print_usage(0,argv[arg],NULL); |
140 | } |
141 | else if(argv[arg][0]=='-' && argv[arg][1]=='-') |
142 | print_usage(0,argv[arg],NULL); |
143 | else |
144 | option_filenames++; |
145 | } |
146 | |
147 | /* Check the specified command line options */ |
148 | |
149 | if(option_parse_only && option_process_only) |
150 | print_usage(0,NULL,"Cannot use '--parse-only' and '--process-only' at the same time."); |
151 | |
152 | if(option_append && option_process_only) |
153 | print_usage(0,NULL,"Cannot use '--append' and '--process-only' at the same time."); |
154 | |
155 | if(option_filenames && option_process_only) |
156 | print_usage(0,NULL,"Cannot use '--process-only' and filenames at the same time."); |
157 | |
158 | if(!option_filenames && !option_process_only) |
159 | print_usage(0,NULL,"File names must be specified unless using '--process-only'"); |
160 | |
161 | if(!option_filesort_ramsize) |
162 | { |
163 | #if SLIM |
164 | option_filesort_ramsize=64*1024*1024; |
165 | #else |
166 | option_filesort_ramsize=256*1024*1024; |
167 | #endif |
168 | } |
169 | else |
170 | option_filesort_ramsize*=1024*1024; |
171 | |
172 | if(!option_tmpdirname) |
173 | { |
174 | if(!dirname) |
175 | option_tmpdirname="."; |
176 | else |
177 | option_tmpdirname=dirname; |
178 | } |
179 | |
180 | if(!option_process_only) |
181 | { |
182 | if(tagging) |
183 | { |
184 | if(!ExistsFile(tagging)) |
185 | { |
186 | fprintf(stderr,"Error: The '--tagging' option specifies a file that does not exist.\n"); |
187 | exit(EXIT_FAILURE); |
188 | } |
189 | } |
190 | else |
191 | { |
192 | if(ExistsFile(FileName(dirname,prefix,"tagging.xml"))) |
193 | tagging=FileName(dirname,prefix,"tagging.xml"); |
194 | else if(ExistsFile(FileName(ROUTINO_DATADIR,NULL,"tagging.xml"))) |
195 | tagging=FileName(ROUTINO_DATADIR,NULL,"tagging.xml"); |
196 | else |
197 | { |
198 | fprintf(stderr,"Error: The '--tagging' option was not used and the default 'tagging.xml' does not exist.\n"); |
199 | exit(EXIT_FAILURE); |
200 | } |
201 | } |
202 | |
203 | if(ParseXMLTaggingRules(tagging)) |
204 | { |
205 | fprintf(stderr,"Error: Cannot read the tagging rules in the file '%s'.\n",tagging); |
206 | exit(EXIT_FAILURE); |
207 | } |
208 | } |
209 | |
210 | /* Create new node, segment, way and relation variables */ |
211 | |
212 | OSMNodes=NewNodeList(option_append||option_changes,option_process_only); |
213 | |
214 | OSMWays=NewWayList(option_append||option_changes,option_process_only); |
215 | |
216 | OSMRelations=NewRelationList(option_append||option_changes,option_process_only); |
217 | |
218 | /* Create the error log file */ |
219 | |
220 | if(errorlog) |
221 | open_errorlog(FileName(dirname,prefix,errorlog),option_append||option_changes||option_process_only,option_keep); |
222 | |
223 | /* Parse the file */ |
224 | |
225 | if(!option_process_only) |
226 | { |
227 | for(arg=1;arg<argc;arg++) |
228 | { |
229 | int fd; |
230 | char *filename,*p; |
231 | |
232 | if(argv[arg][0]=='-' && argv[arg][1]=='-') |
233 | continue; |
234 | |
235 | filename=strcpy(malloc(strlen(argv[arg])+1),argv[arg]); |
236 | |
237 | fd=OpenFile(filename); |
238 | |
239 | if((p=strstr(filename,".bz2")) && !strcmp(p,".bz2")) |
240 | { |
241 | fd=Uncompress_Bzip2(fd); |
242 | *p=0; |
243 | } |
244 | |
245 | if((p=strstr(filename,".gz")) && !strcmp(p,".gz")) |
246 | { |
247 | fd=Uncompress_Gzip(fd); |
248 | *p=0; |
249 | } |
250 | |
251 | if((p=strstr(filename,".xz")) && !strcmp(p,".xz")) |
252 | { |
253 | fd=Uncompress_Xz(fd); |
254 | *p=0; |
255 | } |
256 | |
257 | if(option_changes) |
258 | { |
259 | printf("\nParse OSC Data [%s]\n==============\n\n",filename); |
260 | fflush(stdout); |
261 | |
262 | if((p=strstr(filename,".pbf")) && !strcmp(p,".pbf")) |
263 | { |
264 | logassert(0,"Unable to read a PBF file to apply changes (format does not permit this)"); |
265 | } |
266 | else if((p=strstr(filename,".o5c")) && !strcmp(p,".o5c")) |
267 | { |
268 | if(ParseO5CFile(fd,OSMNodes,OSMWays,OSMRelations)) |
269 | exit(EXIT_FAILURE); |
270 | } |
271 | else |
272 | { |
273 | if(ParseOSCFile(fd,OSMNodes,OSMWays,OSMRelations)) |
274 | exit(EXIT_FAILURE); |
275 | } |
276 | } |
277 | else |
278 | { |
279 | printf("\nParse OSM Data [%s]\n==============\n\n",filename); |
280 | fflush(stdout); |
281 | |
282 | if((p=strstr(filename,".pbf")) && !strcmp(p,".pbf")) |
283 | { |
284 | if(ParsePBFFile(fd,OSMNodes,OSMWays,OSMRelations)) |
285 | exit(EXIT_FAILURE); |
286 | } |
287 | else if((p=strstr(filename,".o5m")) && !strcmp(p,".o5m")) |
288 | { |
289 | if(ParseO5MFile(fd,OSMNodes,OSMWays,OSMRelations)) |
290 | exit(EXIT_FAILURE); |
291 | } |
292 | else |
293 | { |
294 | if(ParseOSMFile(fd,OSMNodes,OSMWays,OSMRelations)) |
295 | exit(EXIT_FAILURE); |
296 | } |
297 | } |
298 | |
299 | CloseFile(fd); |
300 | |
301 | free(filename); |
302 | } |
303 | |
304 | DeleteXMLTaggingRules(); |
305 | } |
306 | |
307 | FinishNodeList(OSMNodes); |
308 | FinishWayList(OSMWays); |
309 | FinishRelationList(OSMRelations); |
310 | |
311 | if(option_parse_only) |
312 | { |
313 | FreeNodeList(OSMNodes,1); |
314 | FreeWayList(OSMWays,1); |
315 | FreeRelationList(OSMRelations,1); |
316 | |
317 | exit(EXIT_SUCCESS); |
318 | } |
319 | |
320 | |
321 | /* Sort the data */ |
322 | |
323 | printf("\nSort OSM Data\n=============\n\n"); |
324 | fflush(stdout); |
325 | |
326 | /* Sort the nodes, ways and relations */ |
327 | |
328 | SortNodeList(OSMNodes); |
329 | |
330 | SortWayList(OSMWays); |
331 | |
332 | SortRelationList(OSMRelations); |
333 | |
334 | /* Process the data */ |
335 | |
336 | printf("\nProcess OSM Data\n================\n\n"); |
337 | fflush(stdout); |
338 | |
339 | /* Remove non-highway nodes by looking through the ways (must be before splitting the ways) */ |
340 | |
341 | RemoveNonHighwayNodes(OSMNodes,OSMWays,option_keep||option_changes); |
342 | |
343 | /* Separate the segments and way names and sort them (must be before processing the segments) */ |
344 | |
345 | OSMSegments=SplitWays(OSMWays,OSMNodes,option_keep||option_changes); |
346 | |
347 | SortWayNames(OSMWays); |
348 | |
349 | SortSegmentList(OSMSegments); |
350 | |
351 | /* Process the segments and index them (must be before processing relations) */ |
352 | |
353 | ProcessSegments(OSMSegments,OSMNodes,OSMWays); |
354 | |
355 | IndexSegments(OSMSegments,OSMNodes,OSMWays); |
356 | |
357 | /* Process the route relations and turn relations (must be before compacting the ways) */ |
358 | |
359 | ProcessRouteRelations(OSMRelations,OSMWays,option_keep||option_changes); |
360 | |
361 | ProcessTurnRelations(OSMRelations,OSMNodes,OSMSegments,OSMWays,option_keep||option_changes); |
362 | |
363 | /* Compact the ways */ |
364 | |
365 | CompactWayList(OSMWays,OSMSegments); |
366 | |
367 | /* Sort the nodes and segments geographically */ |
368 | |
369 | SortNodeListGeographically(OSMNodes); |
370 | |
371 | SortSegmentListGeographically(OSMSegments,OSMNodes); |
372 | |
373 | /* Re-index the segments */ |
374 | |
375 | IndexSegments(OSMSegments,OSMNodes,OSMWays); |
376 | |
377 | /* Sort the turn relations geographically */ |
378 | |
379 | SortTurnRelationListGeographically(OSMRelations,OSMNodes,OSMSegments); |
380 | |
381 | /* Prune unwanted nodes/segments */ |
382 | |
383 | if(option_prune_straight || option_prune_isolated || option_prune_short) |
384 | { |
385 | printf("\nPrune Unneeded Data\n===================\n\n"); |
386 | fflush(stdout); |
387 | |
388 | if(option_prune_straight) |
389 | { |
390 | StartPruning(OSMNodes,OSMSegments,OSMWays); |
391 | |
392 | PruneStraightHighwayNodes(OSMNodes,OSMSegments,OSMWays,option_prune_straight); |
393 | |
394 | FinishPruning(OSMNodes,OSMSegments,OSMWays); |
395 | |
396 | RemovePrunedNodes(OSMNodes,OSMSegments); |
397 | RemovePrunedSegments(OSMSegments,OSMWays); |
398 | CompactWayList(OSMWays,OSMSegments); |
399 | RemovePrunedTurnRelations(OSMRelations,OSMNodes); |
400 | |
401 | IndexSegments(OSMSegments,OSMNodes,OSMWays); |
402 | } |
403 | |
404 | if(option_prune_isolated) |
405 | { |
406 | StartPruning(OSMNodes,OSMSegments,OSMWays); |
407 | |
408 | PruneIsolatedRegions(OSMNodes,OSMSegments,OSMWays,option_prune_isolated); |
409 | |
410 | FinishPruning(OSMNodes,OSMSegments,OSMWays); |
411 | |
412 | RemovePrunedNodes(OSMNodes,OSMSegments); |
413 | RemovePrunedSegments(OSMSegments,OSMWays); |
414 | CompactWayList(OSMWays,OSMSegments); |
415 | RemovePrunedTurnRelations(OSMRelations,OSMNodes); |
416 | |
417 | IndexSegments(OSMSegments,OSMNodes,OSMWays); |
418 | } |
419 | |
420 | if(option_prune_short) |
421 | { |
422 | StartPruning(OSMNodes,OSMSegments,OSMWays); |
423 | |
424 | PruneShortSegments(OSMNodes,OSMSegments,OSMWays,option_prune_short); |
425 | |
426 | FinishPruning(OSMNodes,OSMSegments,OSMWays); |
427 | |
428 | RemovePrunedNodes(OSMNodes,OSMSegments); |
429 | RemovePrunedSegments(OSMSegments,OSMWays); |
430 | CompactWayList(OSMWays,OSMSegments); |
431 | RemovePrunedTurnRelations(OSMRelations,OSMNodes); |
432 | |
433 | IndexSegments(OSMSegments,OSMNodes,OSMWays); |
434 | } |
435 | } |
436 | |
437 | /* Repeated iteration on Super-Nodes and Super-Segments */ |
438 | |
439 | do |
440 | { |
441 | index_t nsuper; |
442 | |
443 | printf("\nProcess Super-Data (iteration %d)\n================================%s\n\n",iteration,iteration>9?"=":""); |
444 | fflush(stdout); |
445 | |
446 | if(iteration==0) |
447 | { |
448 | /* Select the super-nodes */ |
449 | |
450 | ChooseSuperNodes(OSMNodes,OSMSegments,OSMWays); |
451 | |
452 | /* Select the super-segments */ |
453 | |
454 | SuperSegments=CreateSuperSegments(OSMNodes,OSMSegments,OSMWays); |
455 | |
456 | nsuper=OSMSegments->number; |
457 | } |
458 | else |
459 | { |
460 | SegmentsX *SuperSegments2; |
461 | |
462 | /* Index the super-segments */ |
463 | |
464 | IndexSegments(SuperSegments,OSMNodes,OSMWays); |
465 | |
466 | /* Select the super-nodes */ |
467 | |
468 | ChooseSuperNodes(OSMNodes,SuperSegments,OSMWays); |
469 | |
470 | /* Select the super-segments */ |
471 | |
472 | SuperSegments2=CreateSuperSegments(OSMNodes,SuperSegments,OSMWays); |
473 | |
474 | nsuper=SuperSegments->number; |
475 | |
476 | FreeSegmentList(SuperSegments); |
477 | |
478 | SuperSegments=SuperSegments2; |
479 | } |
480 | |
481 | /* Sort the super-segments and remove duplicates */ |
482 | |
483 | DeduplicateSuperSegments(SuperSegments,OSMWays); |
484 | |
485 | /* Check for end condition */ |
486 | |
487 | if(SuperSegments->number==nsuper) |
488 | quit=1; |
489 | |
490 | iteration++; |
491 | |
492 | if(iteration>max_iterations) |
493 | quit=1; |
494 | } |
495 | while(!quit); |
496 | |
497 | /* Combine the super-segments */ |
498 | |
499 | printf("\nCombine Segments and Super-Segments\n===================================\n\n"); |
500 | fflush(stdout); |
501 | |
502 | /* Merge the super-segments */ |
503 | |
504 | MergedSegments=MergeSuperSegments(OSMSegments,SuperSegments); |
505 | |
506 | FreeSegmentList(OSMSegments); |
507 | |
508 | FreeSegmentList(SuperSegments); |
509 | |
510 | OSMSegments=MergedSegments; |
511 | |
512 | /* Cross reference the nodes and segments */ |
513 | |
514 | printf("\nCross-Reference Nodes and Segments\n==================================\n\n"); |
515 | fflush(stdout); |
516 | |
517 | /* Sort the nodes and segments geographically */ |
518 | |
519 | SortNodeListGeographically(OSMNodes); |
520 | |
521 | SortSegmentListGeographically(OSMSegments,OSMNodes); |
522 | |
523 | /* Re-index the segments */ |
524 | |
525 | IndexSegments(OSMSegments,OSMNodes,OSMWays); |
526 | |
527 | /* Sort the turn relations geographically */ |
528 | |
529 | SortTurnRelationListGeographically(OSMRelations,OSMNodes,OSMSegments); |
530 | |
531 | /* Output the results */ |
532 | |
533 | printf("\nWrite Out Database Files\n========================\n\n"); |
534 | fflush(stdout); |
535 | |
536 | /* Write out the nodes */ |
537 | |
538 | SaveNodeList(OSMNodes,FileName(dirname,prefix,"nodes.mem"),OSMSegments); |
539 | |
540 | /* Write out the segments */ |
541 | |
542 | SaveSegmentList(OSMSegments,FileName(dirname,prefix,"segments.mem")); |
543 | |
544 | /* Write out the ways */ |
545 | |
546 | SaveWayList(OSMWays,FileName(dirname,prefix,"ways.mem")); |
547 | |
548 | /* Write out the relations */ |
549 | |
550 | SaveRelationList(OSMRelations,FileName(dirname,prefix,"relations.mem")); |
551 | |
552 | /* Free the memory (delete the temporary files) */ |
553 | |
554 | FreeSegmentList(OSMSegments); |
555 | |
556 | /* Close the error log file and process the data */ |
557 | |
558 | if(errorlog) |
559 | { |
560 | close_errorlog(); |
561 | |
562 | if(option_keep) |
563 | { |
564 | ErrorLogsX *OSMErrorLogs; |
565 | |
566 | printf("\nCreate Error Log\n================\n\n"); |
567 | fflush(stdout); |
568 | |
569 | OSMErrorLogs=NewErrorLogList(); |
570 | |
571 | ProcessErrorLogs(OSMErrorLogs,OSMNodes,OSMWays,OSMRelations); |
572 | |
573 | SortErrorLogsGeographically(OSMErrorLogs); |
574 | |
575 | SaveErrorLogs(OSMErrorLogs,FileName(dirname,prefix,"errorlogs.mem")); |
576 | |
577 | FreeErrorLogList(OSMErrorLogs); |
578 | } |
579 | } |
580 | |
581 | /* Free the memory (delete the temporary files) */ |
582 | |
583 | FreeNodeList(OSMNodes,0); |
584 | FreeWayList(OSMWays,0); |
585 | FreeRelationList(OSMRelations,0); |
586 | |
587 | printf("\n"); |
588 | fflush(stdout); |
589 | |
590 | printf_program_end(); |
591 | |
592 | exit(EXIT_SUCCESS); |
593 | } |
594 | |
595 | |
596 | /*++++++++++++++++++++++++++++++++++++++ |
597 | Print out the usage information. |
598 | |
599 | int detail The level of detail to use - 0 = low, 1 = high. |
600 | |
601 | const char *argerr The argument that gave the error (if there is one). |
602 | |
603 | const char *err Other error message (if there is one). |
604 | ++++++++++++++++++++++++++++++++++++++*/ |
605 | |
606 | static void print_usage(int detail,const char *argerr,const char *err) |
607 | { |
608 | fprintf(stderr, |
609 | "Usage: planetsplitter [--help]\n" |
610 | " [--dir=<dirname>] [--prefix=<name>]\n" |
611 | #if defined(USE_PTHREADS) && USE_PTHREADS |
612 | " [--sort-ram-size=<size>] [--sort-threads=<number>]\n" |
613 | #else |
614 | " [--sort-ram-size=<size>]\n" |
615 | #endif |
616 | " [--tmpdir=<dirname>]\n" |
617 | " [--tagging=<filename>]\n" |
618 | " [--loggable] [--logtime] [--logmemory]\n" |
619 | " [--errorlog[=<name>]]\n" |
620 | " [--parse-only | --process-only]\n" |
621 | " [--append] [--keep] [--changes]\n" |
622 | " [--max-iterations=<number>]\n" |
623 | " [--prune-none]\n" |
624 | " [--prune-isolated=<len>]\n" |
625 | " [--prune-short=<len>]\n" |
626 | " [--prune-straight=<len>]\n" |
627 | " [<filename.osm> ... | <filename.osc> ...\n" |
628 | " | <filename.pbf> ...\n" |
629 | " | <filename.o5m> ... | <filename.o5c> ..." |
630 | #if defined(USE_BZIP2) && USE_BZIP2 |
631 | "\n | <filename.(osm|osc|o5m|o5c).bz2> ..." |
632 | #endif |
633 | #if defined(USE_GZIP) && USE_GZIP |
634 | "\n | <filename.(osm|osc|o5m|o5c).gz> ..." |
635 | #endif |
636 | #if defined(USE_XZ) && USE_XZ |
637 | "\n | <filename.(osm|osc|o5m|o5c).xz> ..." |
638 | #endif |
639 | "]\n"); |
640 | |
641 | if(argerr) |
642 | fprintf(stderr, |
643 | "\n" |
644 | "Error with command line parameter: %s\n",argerr); |
645 | |
646 | if(err) |
647 | fprintf(stderr, |
648 | "\n" |
649 | "Error: %s\n",err); |
650 | |
651 | if(detail) |
652 | fprintf(stderr, |
653 | "\n" |
654 | "--help Prints this information.\n" |
655 | "\n" |
656 | "--dir=<dirname> The directory containing the routing database.\n" |
657 | "--prefix=<name> The filename prefix for the routing database.\n" |
658 | "\n" |
659 | "--sort-ram-size=<size> The amount of RAM (in MB) to use for data sorting\n" |
660 | #if SLIM |
661 | " (defaults to 64MB otherwise.)\n" |
662 | #else |
663 | " (defaults to 256MB otherwise.)\n" |
664 | #endif |
665 | #if defined(USE_PTHREADS) && USE_PTHREADS |
666 | "--sort-threads=<number> The number of threads to use for data sorting.\n" |
667 | #endif |
668 | "\n" |
669 | "--tmpdir=<dirname> The directory name for temporary files.\n" |
670 | " (defaults to the '--dir' option directory.)\n" |
671 | "\n" |
672 | "--tagging=<filename> The name of the XML file containing the tagging rules\n" |
673 | " (defaults to 'tagging.xml' with '--dir' and\n" |
674 | " '--prefix' options or the file installed in\n" |
675 | " '" ROUTINO_DATADIR "').\n" |
676 | "\n" |
677 | "--loggable Print progress messages suitable for logging to file.\n" |
678 | "--logtime Print the elapsed time for each processing step.\n" |
679 | "--logmemory Print the max allocated/mapped memory for each step.\n" |
680 | "--errorlog[=<name>] Log parsing errors to 'error.log' or the given name\n" |
681 | " (the '--dir' and '--prefix' options are applied).\n" |
682 | "\n" |
683 | "--parse-only Parse the OSM/OSC file(s) and store the results.\n" |
684 | "--process-only Process the stored results from previous option.\n" |
685 | "--append Parse the OSM file(s) and append to existing results.\n" |
686 | "--keep Keep the intermediate files after parsing & sorting.\n" |
687 | "--changes Parse the data as an OSC file and apply the changes.\n" |
688 | "\n" |
689 | "--max-iterations=<number> The number of iterations for finding super-nodes\n" |
690 | " (defaults to 5).\n" |
691 | "\n" |
692 | "--prune-none Disable the prune options below, they are re-enabled\n" |
693 | " by adding them to the command line after this option.\n" |
694 | "--prune-isolated=<len> Remove access from small disconnected segment groups\n" |
695 | " (defaults to removing groups under 500m).\n" |
696 | "--prune-short=<len> Remove short segments (defaults to removing segments\n" |
697 | " up to a maximum length of 5m).\n" |
698 | "--prune-straight=<len> Remove nodes in almost straight highways (defaults to\n" |
699 | " removing nodes up to 3m offset from a straight line).\n" |
700 | "\n" |
701 | "<filename.osm>, <filename.osc>, <filename.pbf>, <filename.o5m>, <filename.o5c>\n" |
702 | " The name(s) of the file(s) to read and parse.\n" |
703 | " Filenames ending '.pbf' read as PBF, filenames ending\n" |
704 | " '.o5m' or '.o5c' read as O5M/O5C, others as XML.\n" |
705 | #if defined(USE_BZIP2) && USE_BZIP2 |
706 | " Filenames ending '.bz2' will be bzip2 uncompressed.\n" |
707 | #endif |
708 | #if defined(USE_GZIP) && USE_GZIP |
709 | " Filenames ending '.gz' will be gzip uncompressed.\n" |
710 | #endif |
711 | #if defined(USE_XZ) && USE_XZ |
712 | " Filenames ending '.xz' will be xz uncompressed.\n" |
713 | #endif |
714 | "\n" |
715 | "<transport> defaults to all but can be set to:\n" |
716 | "%s" |
717 | "\n" |
718 | "<highway> can be selected from:\n" |
719 | "%s" |
720 | "\n" |
721 | "<property> can be selected from:\n" |
722 | "%s", |
723 | TransportList(),HighwayList(),PropertyList()); |
724 | |
725 | exit(!detail); |
726 | } |
Properties
Name | Value |
---|---|
cvs:description | Planet file splitter. |