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 | 931889b8daf18a31a2281e5a291b23e3a8aeec01 (patch) | |
tree | 3ae26af7e3347b18ab1e03c803778be8bfe448d5 /navit/navit | |
parent | 555e705be7492fb664dd813877f1c075407cd575 (diff) | |
download | navit-931889b8daf18a31a2281e5a291b23e3a8aeec01.tar.gz |
Add:Core:Added function to dump map into textfile
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1472 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/navit')
-rw-r--r-- | navit/navit/map.c | 24 | ||||
-rw-r--r-- | navit/navit/map.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/navit/navit/map.c b/navit/navit/map.c index d8a8e199e..dbb25e755 100644 --- a/navit/navit/map.c +++ b/navit/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); +} diff --git a/navit/navit/map.h b/navit/navit/map.h index 586ff3ede..4026ab6b7 100644 --- a/navit/navit/map.h +++ b/navit/navit/map.h @@ -251,6 +251,7 @@ struct map_selection *map_selection_dup(struct map_selection *sel); void map_selection_destroy(struct map_selection *sel); int map_selection_contains_item_rect(struct map_selection *sel, struct item *item); int map_priv_is(struct map *map, struct map_priv *priv); +void map_dump(struct map *map); /* end of prototypes */ #endif |