diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-05-02 14:52:09 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-05-02 14:52:09 +0000 |
commit | a75c7f57084452f1fe6b7a0d410931f20571b6c1 (patch) | |
tree | 767e333bd2c40f93ba5ddb1726580edbbe5ac4b8 /navit/maptool/misc.c | |
parent | 0f96cd87c833a47cbb989002b19e48f447abb053 (diff) | |
download | navit-a75c7f57084452f1fe6b7a0d410931f20571b6c1.tar.gz |
Add:maptool:Allow multiple -m parameters
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3219 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/maptool/misc.c')
-rw-r--r-- | navit/maptool/misc.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/navit/maptool/misc.c b/navit/maptool/misc.c index bf77b1f95..73c3d9545 100644 --- a/navit/maptool/misc.c +++ b/navit/maptool/misc.c @@ -96,32 +96,36 @@ contains_bbox(int xl, int yl, int xh, int yh, struct rect *r) } void -phase1_map(struct map *map, FILE *out_ways, FILE *out_nodes) +phase1_map(GList *maps, FILE *out_ways, FILE *out_nodes) { - struct map_rect *mr=map_rect_new(map, NULL); + struct map_rect *mr; struct item *item; int count,max=16384; struct coord ca[max]; struct attr attr; - while ((item = map_rect_get_item(mr))) { - count=item_coord_get(item, ca, item->type < type_line ? 1: max); - item_bin_init(item_bin, item->type); - item_bin_add_coord(item_bin, ca, count); - while (item_attr_get(item, attr_any, &attr)) { - if (attr.type >= attr_type_string_begin && attr.type <= attr_type_string_end) { - attr.u.str=map_convert_string(map, attr.u.str); - item_bin_add_attr(item_bin, &attr); - map_convert_free(attr.u.str); - } else - item_bin_add_attr(item_bin, &attr); + while (maps) { + mr=map_rect_new(maps->data, NULL); + while ((item = map_rect_get_item(mr))) { + count=item_coord_get(item, ca, item->type < type_line ? 1: max); + item_bin_init(item_bin, item->type); + item_bin_add_coord(item_bin, ca, count); + while (item_attr_get(item, attr_any, &attr)) { + if (attr.type >= attr_type_string_begin && attr.type <= attr_type_string_end) { + attr.u.str=map_convert_string(maps->data, attr.u.str); + item_bin_add_attr(item_bin, &attr); + map_convert_free(attr.u.str); + } else + item_bin_add_attr(item_bin, &attr); + } + if (item->type >= type_line) + item_bin_write(item_bin, out_ways); + else + item_bin_write(item_bin, out_nodes); } - if (item->type >= type_line) - item_bin_write(item_bin, out_ways); - else - item_bin_write(item_bin, out_nodes); + map_rect_destroy(mr); + maps=g_list_next(maps); } - map_rect_destroy(mr); } static void |