navit  0.5.3-trunk
maptool.c File Reference
#include "config.h"
#include "navit_lfs.h"
#include <stdlib.h>
#include <glib.h>
#include <assert.h>
#include <string.h>
#include <signal.h>
#include <stdio.h>
#include <math.h>
#include <errno.h>
#include <getopt.h>
#include <unistd.h>
#include <sys/time.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <zlib.h>
#include "file.h"
#include "item.h"
#include "map.h"
#include "main.h"
#include "zipfile.h"
#include "linguistics.h"
#include "plugin.h"
#include "util.h"
#include "maptool.h"

Data Structures

struct  maptool_params
 

Macros

#define SLIZE_SIZE_DEFAULT_GB   1
 

Functions

static int assafe_lltoa (long long n, int maxlen, char *buf)
 
static int assafe_strcp2buf (char *str, int maxlen, char *buf)
 
static void progress_time (void)
 
static void progress_memory (void)
 
static void sig_alrm_do (int sig)
 
void sig_alrm (int sig)
 
void sig_alrm_end (void)
 
static struct files_relation_processingfiles_relation_processing_new (FILE *line2poi, char *suffix)
 
static void files_relation_processing_destroy (struct files_relation_processing *files_relproc, char *suffix)
 
static void add_plugin (char *path)
 
static void maptool_init (FILE *rule_file)
 
static void usage (void)
 
static int parse_option (struct maptool_params *p, char **argv, int argc, int *option_index)
 
static int start_phase (struct maptool_params *p, char *str)
 
static void exit_with_error (char *error_message)
 
static void osm_read_input_data (struct maptool_params *p, char *suffix)
 
static void osm_count_references (struct maptool_params *p, char *suffix, int clear)
 
static void osm_resolve_coords_and_split_at_intersections (struct maptool_params *p, char *suffix)
 
static void osm_process_way2poi (struct maptool_params *p, char *suffix)
 
static void osm_process_coastlines (struct maptool_params *p, char *suffix)
 
static void osm_process_turn_restrictions (struct maptool_params *p, char *suffix)
 
static void osm_process_multipolygons (struct maptool_params *p, char *suffix)
 
static void maptool_dump (struct maptool_params *p, char *suffix)
 
static void maptool_generate_tiles (struct maptool_params *p, char *suffix, char **filenames, int filename_count, int first, char *suffix0)
 
static void maptool_assemble_map (struct maptool_params *p, char *suffix, char **filenames, char **referencenames, int filename_count, int first, int last, char *suffix0)
 
static void maptool_load_node_table (struct maptool_params *p, int last)
 
static void maptool_load_countries (struct maptool_params *p)
 
static void maptool_load_tilesdir (struct maptool_params *p, char *suffix)
 
int main (int argc, char **argv)
 

Variables

long long slice_size =SLIZE_SIZE_DEFAULT_GB*1024ll*1024*1024
 
int attr_debug_level =1
 
int ignore_unknown = 0
 
int thread_count =8
 
GHashTable * dedupe_ways_hash
 
int phase
 
int slices
 
int unknown_country
 
char ch_suffix [] ="r"
 
char * experimental_feature_description
 
int experimental
 
struct buffer node_buffer
 
int processed_nodes
 
int processed_nodes_out
 
int processed_ways
 
int processed_relations
 
int processed_tiles
 
int overlap =1
 
int bytes_read
 
static long start_brk
 
static struct timespec start_ts
 
static struct pluginsplugins
 
int debug_ref =0
 

Macro Definition Documentation

◆ SLIZE_SIZE_DEFAULT_GB

#define SLIZE_SIZE_DEFAULT_GB   1

Function Documentation

◆ add_plugin()

static void add_plugin ( char *  path)
static

◆ assafe_lltoa()

static int assafe_lltoa ( long long  n,
int  maxlen,
char *  buf 
)
static

References c.

Referenced by progress_memory(), progress_time(), and sig_alrm_do().

◆ assafe_strcp2buf()

static int assafe_strcp2buf ( char *  str,
int  maxlen,
char *  buf 
)
static

◆ exit_with_error()

static void exit_with_error ( char *  error_message)
static

References exit.

Referenced by main(), and osm_read_input_data().

◆ files_relation_processing_destroy()

◆ files_relation_processing_new()

static struct files_relation_processing* files_relation_processing_new ( FILE *  line2poi,
char *  suffix 
)
static

References tempfile().

Referenced by main().

◆ main()

◆ maptool_assemble_map()

◆ maptool_dump()

static void maptool_dump ( struct maptool_params p,
char *  suffix 
)
static

References dump(), p, and tempfile().

Referenced by main().

◆ maptool_generate_tiles()

static void maptool_generate_tiles ( struct maptool_params p,
char *  suffix,
char **  filenames,
int  filename_count,
int  first,
char *  suffix0 
)
static

◆ maptool_init()

static void maptool_init ( FILE *  rule_file)
static

References osm_init(), and plugins_init().

Referenced by main().

◆ maptool_load_countries()

static void maptool_load_countries ( struct maptool_params p)
static

References load_countries(), and p.

Referenced by main().

◆ maptool_load_node_table()

static void maptool_load_node_table ( struct maptool_params p,
int  last 
)
static

References load_buffer(), node_buffer, p, sizeof_buffer(), slice_size, and slices.

Referenced by main().

◆ maptool_load_tilesdir()

static void maptool_load_tilesdir ( struct maptool_params p,
char *  suffix 
)
static

References load_tilesdir(), p, and tempfile().

Referenced by main().

◆ osm_count_references()

static void osm_count_references ( struct maptool_params p,
char *  suffix,
int  clear 
)
static

◆ osm_process_coastlines()

static void osm_process_coastlines ( struct maptool_params p,
char *  suffix 
)
static

References process_coastlines(), and tempfile().

Referenced by main().

◆ osm_process_multipolygons()

static void osm_process_multipolygons ( struct maptool_params p,
char *  suffix 
)
static

References p, process_multipolygons(), tempfile(), and tempfile_unlink().

Referenced by main().

◆ osm_process_turn_restrictions()

static void osm_process_turn_restrictions ( struct maptool_params p,
char *  suffix 
)
static

◆ osm_process_way2poi()

static void osm_process_way2poi ( struct maptool_params p,
char *  suffix 
)
static

References process_way2poi(), and tempfile().

Referenced by main().

◆ osm_read_input_data()

◆ osm_resolve_coords_and_split_at_intersections()

static void osm_resolve_coords_and_split_at_intersections ( struct maptool_params p,
char *  suffix 
)
static

◆ parse_option()

static int parse_option ( struct maptool_params p,
char **  argv,
int  argc,
int *  option_index 
)
static

◆ progress_memory()

static void progress_memory ( void  )
static

◆ progress_time()

static void progress_time ( void  )
static

◆ sig_alrm()

◆ sig_alrm_do()

◆ sig_alrm_end()

◆ start_phase()

static int start_phase ( struct maptool_params p,
char *  str 
)
static

References p, phase, progress_memory(), and progress_time().

Referenced by main().

◆ usage()

static void usage ( void  )
static

Variable Documentation

◆ attr_debug_level

int attr_debug_level =1

Referenced by osm_add_tag(), and parse_option().

◆ bytes_read

int bytes_read

◆ ch_suffix

char ch_suffix[] ="r"

◆ debug_ref

int debug_ref =0

◆ dedupe_ways_hash

GHashTable* dedupe_ways_hash

Referenced by osm_end_way(), and parse_option().

◆ experimental

int experimental

Indicates if experimental features (if available) were enabled.

Referenced by item_order_by_type(), main(), and parse_option().

◆ experimental_feature_description

char* experimental_feature_description
Initial value:
=
"Move coastline data to order 6 tiles. Makes map look more smooth, but may affect drawing/searching performance."

Textual description of available experimental features, or NULL (=none available).

Referenced by main(), and usage().

◆ ignore_unknown

int ignore_unknown = 0

Referenced by filter_unknown(), and parse_option().

◆ node_buffer

◆ overlap

◆ phase

int phase

◆ plugins

struct plugins* plugins
static

Referenced by add_plugin().

◆ processed_nodes

◆ processed_nodes_out

◆ processed_relations

◆ processed_tiles

◆ processed_ways

◆ slice_size

◆ slices

◆ start_brk

long start_brk
static

Referenced by main(), and progress_memory().

◆ start_ts

struct timespec start_ts
static

Referenced by main(), and progress_time().

◆ thread_count

◆ unknown_country

int unknown_country

Referenced by osm_process_towns(), and parse_option().