navit  0.5.1-trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups
garmin_img.c File Reference
#include <glib.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "config.h"
#include "plugin.h"
#include "data.h"
#include "projection.h"
#include "map.h"
#include "maptype.h"
#include "item.h"
#include "attr.h"
#include "coord.h"
#include "transform.h"

Data Structures

struct  file
 
struct  offset_len
 
struct  timestamp
 
struct  img_header
 
struct  fat_block
 
struct  file_header
 
struct  region_header
 
struct  map_priv
 Represents the map from a single binfile. More...
 
struct  map_rect_priv
 Implementation-specific map rect data. More...
 
struct  label_data_offset
 
struct  label_data
 
struct  tree_header
 
struct  label_header
 
struct  triple
 
struct  tcoord
 
struct  level
 
struct  subdivision
 
struct  rgn_point
 
struct  rgn_poly
 

Functions

static void * file_read (struct file *f, int offset, int size)
 
static void file_free (void *ptr)
 
struct offset_len __attribute ((packed))
 
static void dump_offset_len (struct offset_len *off_len)
 
struct timestamp __attribute__ ((packed))
 
static void dump_ts (struct timestamp *ts)
 
static void dump_file (struct file_header *fil_hdr)
 
static int contains_coord (char *line)
 
static int get_tag (char *line, char *name, int *pos, char *ret)
 
static void get_line (struct map_rect_priv *mr)
 
static void map_destroy_garmin_img (struct map_priv *m)
 
static char * map_charset_garmin_img (struct map_priv *m)
 
static enum projection map_projection_garmin_img (struct map_priv *m)
 
static void dump_label_data (struct label_data *lbl_dat)
 
static void dump_tree_header (struct tree_header *tre_hdr)
 
static unsigned int triple_u (struct triple *t)
 
static int triple (struct triple *t)
 
static void dump_triple_u (struct triple *t)
 
static void dump_tcoord (struct tcoord *t)
 
static void dump_level (struct level *lvl)
 
static void dump_subdivision (struct subdivision *sub)
 
static void dump_point (struct rgn_point *pnt)
 
static void dump_poly (struct rgn_poly *ply)
 
static void dump_hex (void *ptr, int len)
 
static void dump_hex_r (void *ptr, int len, int rec)
 
static void dump_levels (struct map_rect_priv *mr)
 
static void garmin_img_coord_rewind (void *priv_data)
 
static void parse_line (struct map_rect_priv *mr)
 
static int get_bits (struct map_rect_priv *mr, int bits)
 
static int garmin_img_coord_get (void *priv_data, struct coord *c, int count)
 
static char * get_label_offset (struct map_rect_priv *mr, int offset)
 
static void garmin_img_attr_rewind (void *priv_data)
 
static int garmin_img_attr_get (void *priv_data, enum attr_type attr_type, struct attr *attr)
 
static int rgn_next_type (struct map_rect_priv *mr)
 
static int sub_next (struct map_rect_priv *mr, int next)
 
static struct map_rect_privmap_rect_new_garmin_img (struct map_priv *map, struct coord_rect *r, struct layer *layers, int limit)
 
static void map_rect_destroy_garmin_img (struct map_rect_priv *mr)
 
static struct itemmap_rect_get_item_garmin_img (struct map_rect_priv *mr)
 
static struct itemmap_rect_get_item_byid_garmin_img (struct map_rect_priv *mr, int id_hi, int id_lo)
 
static struct map_privmap_new_garmin_img (struct map_methods *meth, struct attr **attrs)
 
void plugin_init (void)
 

Variables

int shift =5
 
int subdiv_next =0x10
 
int offset
 
int length
 
short creation_year
 
char creation_month
 
char creation_day
 
char creation_hour
 
char creation_minute
 
char creation_second
 
char xor
 
char zero1 [9]
 
char update_month
 
char update_year
 
char zero2 [3]
 
char checksum [1]
 
char signature [7]
 
char unknown1 [1]
 
char unknown2 [2]
 
char unknown3 [2]
 
char unknown4 [2]
 
char unknown5 [2]
 
char zero3 [25]
 
struct timestamp ts
 
char unknown6
 
char map_file_identifier [7]
 
char unknown12
 
char map_description1 [20]
 
short unknown13
 
short unknown14
 
char e1
 
char e2
 
char other [413]
 
char zero4 [512]
 
char unknown7
 
char unknown8 [11]
 
int file_offset
 
char unknown9
 
char unknown10 [15]
 
char unknown11 [480]
 
char flag
 
char filename [8]
 
char type [3]
 
int size
 
char part
 
char zero [14]
 
unsigned short blocks [240]
 
short header_len
 
struct file_header fil_hdr
 
struct offset_len offset_len
 
struct map_priv __attribute__
 
static int map_id
 
static int debug =1
 
char multiplier
 
char data
 
struct tree_header __attribute
 
struct label_data_offset label
 
struct label_data country
 
struct label_data region
 
struct label_data city
 
struct label_data poi_index
 
struct label_data_offset poi_properties
 
struct label_data poi_types
 
struct label_data zip
 
struct label_data hway
 
struct label_data exit
 
struct label_data hway_data
 
struct offset_len sort_descriptor
 
struct label_data lbl13
 
struct label_data lbl14
 
struct triple lng lat
 
unsigned char zoom
 
unsigned char bits_per_coord
 
unsigned short subdivisions
 
struct triple rgn_offset
 
unsigned char types
 
struct tcoord center
 
unsigned short width
 
unsigned short height
 
unsigned short next
 
unsigned char info
 
struct triple lbl_offset
 
short lng_delta
 
short lat_delta
 
unsigned char subtype
 
unsigned char bitstream_len
 
unsigned char bitstream_info
 
static struct item_methods methods_garmin_img
 
int item_count
 
static struct map_methods map_methods_garmin_img
 

Function Documentation

struct offset_len __attribute ( (packed)  )
struct timestamp __attribute__ ( (packed)  )
static int contains_coord ( char *  line)
static
static void dump_file ( struct file_header fil_hdr)
static

Referenced by map_rect_new_garmin_img().

static void dump_hex ( void *  ptr,
int  len 
)
static

References c.

Referenced by map_rect_get_item_garmin_img(), and sub_next().

static void dump_hex_r ( void *  ptr,
int  len,
int  rec 
)
static

References c.

Referenced by map_rect_new_garmin_img(), and sub_next().

static void dump_label_data ( struct label_data lbl_dat)
static
static void dump_level ( struct level lvl)
static

Referenced by dump_levels().

static void dump_offset_len ( struct offset_len off_len)
static

Referenced by dump_label_data().

static void dump_poly ( struct rgn_poly ply)
static

References triple_u().

Referenced by map_rect_get_item_garmin_img().

static void dump_subdivision ( struct subdivision sub)
static

Referenced by garmin_img_coord_get(), and sub_next().

static void dump_tcoord ( struct tcoord t)
static
static void dump_tree_header ( struct tree_header tre_hdr)
static

Referenced by map_rect_new_garmin_img().

static void dump_triple_u ( struct triple t)
static
static void dump_ts ( struct timestamp ts)
static
static void file_free ( void *  ptr)
static
static void* file_read ( struct file f,
int  offset,
int  size 
)
static
static int garmin_img_attr_get ( void *  priv_data,
enum attr_type  attr_type,
struct attr attr 
)
static
static void garmin_img_attr_rewind ( void *  priv_data)
static
static void garmin_img_coord_rewind ( void *  priv_data)
static
static int get_bits ( struct map_rect_priv mr,
int  bits 
)
static
static void get_line ( struct map_rect_priv mr)
static
static int get_tag ( char *  line,
char *  name,
int pos,
char *  ret 
)
static

References p, and startup::pos.

static char* map_charset_garmin_img ( struct map_priv m)
static
static void map_destroy_garmin_img ( struct map_priv m)
static
static struct map_priv* map_new_garmin_img ( struct map_methods meth,
struct attr **  attrs 
)
static
static enum projection map_projection_garmin_img ( struct map_priv m)
static

References projection_garmin.

static void map_rect_destroy_garmin_img ( struct map_rect_priv mr)
static

References map_rect_priv::f.

static struct item* map_rect_get_item_byid_garmin_img ( struct map_rect_priv mr,
int  id_hi,
int  id_lo 
)
static
void plugin_init ( void  )

References map_new_garmin_img().

static int triple ( struct triple t)
static

References triple::data.

Referenced by garmin_img_coord_get().

static unsigned int triple_u ( struct triple t)
static

Variable Documentation

struct { ... } ::__attribute
struct street_type __attribute__
unsigned char bits_per_coord
unsigned char bitstream_info
unsigned char bitstream_len
unsigned short blocks[240]
char checksum[1]

Referenced by mapExtract::mapExtract().

struct label_data city
char creation_day
char creation_hour
char creation_minute
char creation_month
char creation_second
short creation_year
unsigned char data

Referenced by NGQPoint::_coordName(), add_tile_hash(), attr_data_set(), attr_data_set_le(), attr_to_text_ext(), binfile_attr_set(), binfile_coord_set(), binmap_search_by_index(), bookmarks_copy_bookmark(), bookmarks_delete_bookmark(), bookmarks_get_bookmark_count(), bookmarks_move_down(), bookmarks_new(), bookmarks_rename_bookmark(), cache_insert_new(), ch_setup(), download_download(), draw_mode(), draw_text(), fh_comparedata(), fh_deleteel(), fh_insert(), fh_insertkey(), fh_replacekeydata(), fh_setneginf(), foreach_tile_func(), get_string(), gmap_new(), graphics_opengl_set_callbacks(), gui_gtk_add_menu(), gui_gtk_bookmarks_update(), gui_gtk_destinations_update(), gui_gtk_layouts_init(), gui_gtk_projections_init(), gui_gtk_vehicles_update(), gui_internal_button(), gui_internal_button_font_new_with_callback(), gui_internal_call_linked_on_finish(), gui_internal_cmd_add_bookmark2(), gui_internal_cmd_add_bookmark_folder2(), gui_internal_cmd_insert_destination_do(), gui_internal_cmd_map_download(), gui_internal_cmd_map_download_do(), gui_internal_cmd_pois(), gui_internal_cmd_pois_filter_do(), gui_internal_cmd_set_active_profile(), gui_internal_cmd_set_destination(), gui_internal_html_end(), gui_internal_html_start(), gui_internal_html_text(), gui_internal_keypress(), gui_internal_motion(), gui_internal_new(), gui_internal_prune_menu_do(), gui_internal_resize(), gui_internal_set_data(), gui_internal_table_button_prev(), gui_internal_widget_table_new(), image_new(), j1850_idle(), Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel(), log_new(), longest_match_item_new(), map_binfile_download_size(), map_collect_data_osm_protobuf(), map_new_binfile(), map_new_csv(), map_new_garmin_img(), map_new_mg(), map_new_shapefile(), map_new_textfile(), map_rect_new_shapefile(), mapExtract::mapExtract(), maps_new(), navigation_get_map(), navit_button(), navit_motion(), navit_popup(), navit_resize(), org.navitproject.navit.Navit::onActivityResult(), parse_required_member(), protobuf_c_message_free_unpacked(), protobuf_c_message_unpack(), qt_qpainter_draw(), quadtree_item_free_do(), read_former_destinations_from_file(), request_graphics_get_data(), request_set_add_remove_attr(), route_get_map_helper(), org.navitproject.navit.NavitDialogs::sendDialogMessage(), test(), tracking_get_map(), vehicle_file_io(), and write_tilesdir().

int debug =1
static
char e2
struct file_header fil_hdr
int file_offset
char flag
short header_len

Referenced by repeated_field_pack().

struct label_data hway
struct label_data hway_data
short lat_delta
struct label_data lbl13
struct label_data lbl14
struct triple lbl_offset
short lng_delta
char map_description1[20]
char map_file_identifier[7]
int map_id
static

Referenced by map_new_garmin_img().

struct map_methods map_methods_garmin_img
static
Initial value:
= {
"iso8859-1",
}
static void map_rect_destroy_garmin_img(struct map_rect_priv *mr)
Definition: garmin_img.c:1201
static char * map_charset_garmin_img(struct map_priv *m)
Definition: garmin_img.c:351
static struct map_rect_priv * map_rect_new_garmin_img(struct map_priv *map, struct coord_rect *r, struct layer *layers, int limit)
Definition: garmin_img.c:1075
Definition: projection.h:26
static void map_destroy_garmin_img(struct map_priv *m)
Definition: garmin_img.c:343
static enum projection map_projection_garmin_img(struct map_priv *m)
Definition: garmin_img.c:357
static struct item * map_rect_get_item_garmin_img(struct map_rect_priv *mr)
Definition: garmin_img.c:1209
static struct item * map_rect_get_item_byid_garmin_img(struct map_rect_priv *mr, int id_hi, int id_lo)
Definition: garmin_img.c:1473

Referenced by map_new_garmin_img().

struct item_methods methods_garmin_img
static
Initial value:
= {
}
static void garmin_img_coord_rewind(void *priv_data)
Definition: garmin_img.c:784
static int garmin_img_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
Definition: garmin_img.c:940
static int garmin_img_coord_get(void *priv_data, struct coord *c, int count)
Definition: garmin_img.c:810
static void garmin_img_attr_rewind(void *priv_data)
Definition: garmin_img.c:935

Referenced by map_rect_new_garmin_img().

char multiplier
char other[413]
char part
struct label_data poi_index
struct label_data_offset poi_properties
struct label_data poi_types
struct label_data region
struct triple rgn_offset
char signature[7]
struct offset_len sort_descriptor
unsigned short subdivisions
unsigned char subtype
struct timestamp ts
char type

Referenced by add_menu(), attr_bin_write_data(), attr_generic_remove_attr(), attr_resolve(), attr_to_text_ext(), binfile_attr_get(), binmap_get_attr(), bookmarks_append_destinations(), bookmarks_new(), callback_new_attr(), command_call_function(), csv_attr_set(), displaylist_update_layers(), Backend::filter_pois(), graphics_remove_selection(), gui_internal_cmd2(), gui_internal_cmd2_bookmarks(), gui_internal_cmd2_pois(), gui_internal_cmd2_position(), gui_internal_cmd2_set(), gui_internal_cmd_escape(), gui_internal_cmd_menu2(), gui_internal_cmd_pois_item(), gui_internal_cmd_pois_item_selected(), gui_internal_cmd_view_on_map(), gui_internal_get_attr(), gui_internal_html_start(), gui_internal_set_refresh_callback(), gui_qml_get_attr(), index_init(), item_bin_add_attr_int(), item_bin_add_attr_longlong(), item_bin_add_attr_range(), item_bin_add_attr_string(), item_bin_set_type(), item_bin_set_type_by_population(), item_bin_to_poly_segment(), itembin_warning(), itemgra_new(), Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel(), layer_get_attr(), layout_get_attr(), load_types_file(), map_csv_debug_dump_hash_item(), map_filter_new(), map_get_attr(), map_new(), map_new_py(), map_rect_get_item_shapefile(), map_rect_get_item_textfile(), mapExtract::mapExtract(), mapset_get_attr(), navigation_get_attr(), navigation_get_map(), navit_cmd_get_attr_var(), navit_cmd_get_int_var(), navit_cmd_map_add_curr_pos(), navit_cmd_map_item_set_attr(), navit_cmd_push_int(), navit_cmd_say(), navit_cmd_set_attr_var(), navit_cmd_set_center(), navit_cmd_set_destination(), navit_cmd_set_int_var(), navit_cmd_spawn(), navit_cmd_switch_layout_day_night(), navit_cmd_toggle_layer(), navit_get_attr(), navit_get_coord(), org.navitproject.navit.NavitAddressSearchActivity.NavitAddress::NavitAddress(), osd_cmd_odometer_reset(), osd_new(), osm_end_relation(), osm_protobufdb_parse_member(), parse_member(), process_turn_restrictions_fromto(), process_turn_restrictions_member(), read_former_destinations_from_file(), request_callback_new(), route_get_attr(), route_get_destination_description(), route_get_map_helper(), set_hash_entry(), tracking_get_attr(), tracking_get_map(), transform_get_attr(), vehicle_android_position_attr_get(), vehicle_demo_position_attr_get(), vehicle_file_position_attr_get(), vehicle_file_sat_attr_get(), vehicle_gpsd_dbus_position_attr_get(), vehicle_gpsd_position_attr_get(), vehicle_gypsy_position_attr_get(), vehicle_iphone_position_attr_get(), vehicle_maemo_position_attr_get(), vehicle_new(), vehicle_null_position_attr_get(), vehicle_qt5_position_attr_get(), vehicle_webos_position_attr_get(), vehicle_wince_position_attr_get(), vehicle_wince_sat_attr_get(), write_item_way_subsection(), and xmlconfig_announce().

int unknown1
char unknown10[15]
char unknown11[480]
char unknown12
short unknown13
short unknown14
short unknown2
char unknown3[2]
char unknown4[2]
char unknown5[2]
char unknown6
char unknown7
char unknown8[11]
char unknown9
char update_month
char update_year
char xor
int zero
short zero1
char zero2
char zero3[25]
char zero4[512]
struct label_data zip

Referenced by mapExtract::mapExtract().

unsigned char zoom

Referenced by navit_new(), and navit_set_attr_do().