diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-10-15 14:11:45 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-10-15 14:11:45 +0000 |
commit | 82f8d2849b853497066482095a59ccc647264af1 (patch) | |
tree | 7295ddb609e057d49a112c23c13b6078cc5bd2b2 /navit/map.c | |
parent | 9d5d703d372fc33370127b20a12e67748fc28b0f (diff) | |
download | navit-82f8d2849b853497066482095a59ccc647264af1.tar.gz |
Add:Core:Added function to dump map into textfile
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1472 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/map.c')
-rw-r--r-- | navit/map.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/navit/map.c b/navit/map.c index d8a8e199e..dbb25e755 100644 --- a/navit/map.c +++ b/navit/map.c @@ -577,3 +577,27 @@ map_priv_is(struct map *map, struct map_priv *priv) { return (map->priv == priv); } + +void +map_dump(struct map *map) +{ + struct map_rect *mr=map_rect_new(map, NULL); + struct item *item; + int i,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); + if (item->type < type_line) + printf("mg:0x%x 0x%x ", ca[0].x, ca[0].y); + printf("%s", item_to_name(item->type)); + while (item_attr_get(item, attr_any, &attr)) + printf(" %s='%s'", attr_to_name(attr.type), attr_to_text(&attr, map, 1)); + printf("\n"); + if (item->type >= type_line) + for (i = 0 ; i < count ; i++) + printf("mg:0x%x 0x%x\n", ca[i].x, ca[i].y); + } + map_rect_destroy(mr); +} |