navit
0.5.3-trunk
|
#include "navit_lfs.h"
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include "maptool.h"
#include "debug.h"
#include "linguistics.h"
#include "country.h"
#include "file.h"
#include "profile.h"
#include "types.h"
#include "transform.h"
Data Structures | |
struct | attr_mapping |
struct | country_table |
struct | town_country |
struct | relation_member |
struct | associated_street |
struct | process_relation_member_func_priv |
struct | house_number_interpolation |
struct | multipolygon |
struct | process_multipolygon_setup_thread |
worker thread private storage More... | |
struct | turn_restriction |
struct | process_turn_restrictions_setup_thread |
worker thread private storage More... | |
Macros | |
#define | M_PI 3.14159265358979323846 |
#define | M_PI_4 0.785398163397448309616 |
#define | MAX_COORD_COUNT 65536 |
#define | REF_MARKER (1ull << 30) |
#define | REF_MASK (3ull << 30) |
#define | IS_REF(c) (((c).x & REF_MASK)==REF_MARKER) |
#define | GET_REF(c) ((((osmid)(c).x & ~REF_MARKER)<<31) + (c).y ) |
#define | SET_REF(c, ref) do { (c).x = REF_MARKER | ((osmid)(ref)>>31); (c).y = (osmid)(ref) & 0x7fffffffull; } while(0) |
#define | MAX_TOWN_ADMIN_LEVELS 11 |
Functions | |
static void | nodes_ref_item_bin (struct item_bin *ib) |
static int | attr_longest_match (struct attr_mapping **mapping, int mapping_count, enum item_type *types, int types_count) |
static void | attr_longest_match_clear (void) |
static void | build_attrmap_line (char *line) |
static void | build_attrmap (FILE *rule_file) |
static void | build_countrytable (void) |
static void | osm_logv (char *prefix, char *objtype, osmid id, int cont, struct coord_geo *geo, char *fmt, va_list ap) |
void | osm_warning (char *type, osmid id, int cont, char *fmt,...) |
void | osm_info (char *type, osmid id, int cont, char *fmt,...) |
static void | itembin_warning (struct item_bin *ib, int cont, char *fmt,...) |
static void | attr_strings_clear (void) |
static void | attr_strings_save (enum attr_strings_type id, char *str) |
static osmid | item_bin_get_nodeid_from_attr (struct item_bin *ib, enum attr_type attr_type) |
osmid | item_bin_get_nodeid (struct item_bin *ib) |
osmid | item_bin_get_wayid (struct item_bin *ib) |
osmid | item_bin_get_relationid (struct item_bin *ib) |
osmid | item_bin_get_id (struct item_bin *ib) |
static void | relation_add_tag (char *k, char *v) |
static int | access_value (char *v) |
static void | osm_update_attr_present (char *k, char *v) |
void | osm_add_tag (char *k, char *v) |
static void | extend_buffer (struct buffer *b) |
static void | node_buffer_to_hash (void) |
void | flush_nodes (int final) |
static struct node_item * | allocate_node_item_in_buffer (void) |
static void | remove_last_node_item_from_buffer (void) |
void | osm_add_node (osmid id, double lat, double lon) |
void | clear_node_item_buffer (void) |
static long long | node_item_find_index_in_ordered_list (osmid id) |
static struct node_item * | node_item_get (osmid id) |
void | osm_add_way (osmid id) |
void | osm_add_relation (osmid id) |
static int | country_id_from_iso2 (char *iso) |
static struct country_table * | country_from_countryid (int id) |
struct country_table * | country_from_iso2 (char *iso) |
static int | filter_unknown (struct item_bin *ib) |
static void | osm_end_relation_multipolygon (struct maptool_osm *osm) |
void | osm_end_relation (struct maptool_osm *osm) |
void | osm_add_member (enum relation_member_type type, osmid ref, char *role) |
void | osm_end_way (struct maptool_osm *osm) |
void | osm_end_node (struct maptool_osm *osm) |
static struct town_country * | town_country_new (struct country_table *country) |
static void | town_country_destroy (struct town_country *tc) |
static struct town_country * | town_country_list_insert_if_new (GList **town_country_list, struct country_table *country) |
static GList * | osm_process_town_unknown_country (void) |
static char * | osm_process_town_get_town_name_from_is_in (struct item_bin *ib, GHashTable *town_hash) |
static GList * | osm_process_town_by_is_in (struct item_bin *ib) |
static void | osm_process_town_by_boundary_update_attrs (struct item_bin *town, struct town_country *tc, GList *matches) |
static GList * | osm_process_town_by_boundary (GList *bl, struct item_bin *town, struct coord *c) |
static void | osm_town_relations_to_poly (GList *boundaries, FILE *towns_poly) |
void | osm_process_towns (FILE *in, FILE *boundaries, FILE *ways, char *suffix) |
void | sort_countries (int keep_tmpfiles) |
static void | parse_relation_member_string (char *relation_member_string, struct relation_member *memb) |
static int | search_relation_member (struct item_bin *ib, char *role, struct relation_member *memb, int *min_count) |
static void | process_associated_street_member (void *func_priv, void *relation_priv, struct item_bin *member, void *member_priv_unused) |
static void | process_house_number_interpolation_member (void *func_priv, void *relation_priv, struct item_bin *member, void *member_priv_unused) |
static void | relation_func_writethrough (void *func_priv, void *relation_priv_unused, struct item_bin *member, void *member_priv_unused) |
static void | process_associated_streets_setup (FILE *in, struct relations *relations, struct process_relation_member_func_priv *fp) |
static void | g_free_helper (void *data, void *user_data) |
void | process_associated_streets (FILE *in, struct files_relation_processing *files_relproc) |
static void | process_house_number_interpolations_setup (FILE *in, struct relations *relations, struct process_relation_member_func_priv *fp) |
void | process_house_number_interpolations (FILE *in, struct files_relation_processing *files_relproc) |
static int | process_multipolygons_find_match (struct item_bin *part, int part_used, int in_count, struct item_bin **parts, int *used) |
find the nect matching polygon segment This can be used to find the next matching "line" to form a polygon. More... | |
static int | is_loop (struct item_bin *start_part, int start_used, struct item_bin *end_part, int end_used) |
static int | process_multipolygons_find_loop (int in_count, struct item_bin **parts, int *sequence, int *used) |
int | process_multipolygons_find_loops (osmid relid, int in_count, struct item_bin **parts, int **scount, int ***sequences, int **direction) |
int | process_multipolygons_loop_dump (struct item_bin **bin, int scount, int *sequence, int *direction, struct coord *buffer) |
int | process_multipolygons_loop_count (struct item_bin **bin, int scount, int *sequence) |
get number of coordinates inside a sequence calculated by process_multipolygon_find_loop More... | |
static void | dump_sequence (const char *string, int loop_count, int *scount, int **sequences, int *direction) |
static void | process_multipolygons_finish (GList *tr, FILE *out) |
static void | process_multipolygons_member (void *func_priv, void *relation_priv, struct item_bin *member, void *member_priv) |
static void | process_multipolygons_setup_one (struct item_bin *ib, struct relations *relations, struct relations_func *relations_func, GList **multipolygons) |
prepare one multipolygon relation for relattion processing More... | |
static gpointer | process_multipolygons_setup_worker (gpointer data) |
multipolygons setup worker thread. More... | |
static GList ** | process_multipolygons_setup (FILE *in, int thread_count, struct relations **relations) |
prepare multipolygon way matching More... | |
void | process_multipolygons (FILE *in, FILE *coords, FILE *ways, FILE *ways_index, FILE *out) |
static void | process_turn_restrictions_member (void *func_priv, void *relation_priv, struct item_bin *member, void *member_priv) |
static void | process_turn_restrictions_fromto (struct turn_restriction *t, int type, struct coord **c) |
static void | process_turn_restrictions_dump_coord (struct coord *c, int count) |
static void | process_turn_restrictions_finish (GList *tr, FILE *out) |
static void | process_turn_restrictions_setup_one (struct item_bin *ib, struct relations *relations, struct relations_func *relations_func, GList **turn_restrictions) |
prepare one multipolygon relation for relattion processing More... | |
static gpointer | process_turn_restrictions_setup_worker (gpointer data) |
turn restrictions setup worker thread. More... | |
static GList ** | process_turn_restrictions_setup (FILE *in, int thread_count, struct relations **relations) |
prepare turn restriction way matching More... | |
void | process_turn_restrictions (FILE *in, FILE *coords, FILE *ways, FILE *ways_index, FILE *out) |
static void | node_ref_way (osmid node) |
void | osm_add_nd (osmid ref) |
static void | write_item_way_subsection_index (FILE *out, FILE *out_index, FILE *out_graph, struct item_bin *orig, long long *last_id) |
static void | write_item_way_subsection (FILE *out, FILE *out_index, FILE *out_graph, struct item_bin *orig, int first, int last, long long *last_id) |
void | ref_ways (FILE *in) |
void | resolve_ways (FILE *in, FILE *out) |
void | process_way2poi (FILE *in, FILE *out, int type) |
int | map_resolve_coords_and_split_at_intersections (FILE *in, FILE *out, FILE *out_index, FILE *out_graph, FILE *out_coastline, int final) |
static void | index_country_add (struct zip_info *info, int country_id, char *first_key, char *last_key, char *tile, char *filename, int size, FILE *out) |
void | write_countrydir (struct zip_info *zip_info, int max_index_size) |
void | load_countries (void) |
void | remove_countryfiles (void) |
void | osm_init (FILE *rule_file) |
#define GET_REF | ( | c | ) | ((((osmid)(c).x & ~REF_MARKER)<<31) + (c).y ) |
#define IS_REF | ( | c | ) | (((c).x & REF_MASK)==REF_MARKER) |
#define M_PI 3.14159265358979323846 |
#define M_PI_4 0.785398163397448309616 |
#define MAX_COORD_COUNT 65536 |
#define MAX_TOWN_ADMIN_LEVELS 11 |
#define REF_MARKER (1ull << 30) |
#define REF_MASK (3ull << 30) |
#define SET_REF | ( | c, | |
ref | |||
) | do { (c).x = REF_MARKER | ((osmid)(ref)>>31); (c).y = (osmid)(ref) & 0x7fffffffull; } while(0) |
enum attr_strings_type |
|
static |
Referenced by osm_add_tag().
|
static |
References buffer::base, extend_buffer(), flush_nodes(), buffer::malloced, node_buffer, buffer::size, and slice_size.
Referenced by osm_add_node().
|
static |
References attr_present, attr_mapping::attr_present_idx, attr_mapping::attr_present_idx_count, attr_mapping::type, and types.
Referenced by osm_end_node(), osm_end_relation_multipolygon(), and osm_end_way().
|
static |
References attr_present, and attr_present_count.
Referenced by osm_end_node(), osm_end_relation(), and osm_end_way().
|
static |
References attr_strings, and attr_strings_buffer_free_offset.
Referenced by osm_add_node(), osm_add_relation(), and osm_add_way().
|
static |
References attr_strings, attr_strings_buffer, attr_strings_buffer_free_offset, and dbg_assert.
Referenced by osm_add_tag(), and relation_add_tag().
|
static |
References attr_hash, attr_present, attr_present_count, attrmap, build_attrmap_line(), and p.
|
static |
References attr_hash, attr_mapping_node, attr_mapping_node_count, attr_mapping_rel2poly_place, attr_mapping_rel2poly_place_count, attr_mapping_way, attr_mapping_way2poi, attr_mapping_way2poi_count, attr_mapping_way_count, attr_present_count, attr_mapping::attr_present_idx, attr_mapping::attr_present_idx_count, item_from_name(), item_is_poly_place, p, and attr_mapping::type.
Referenced by build_attrmap().
|
static |
References country_table, and country_table_hash.
void clear_node_item_buffer | ( | void | ) |
References buffer::base, node_buffer, node_item::ref_way, and buffer::size.
Referenced by osm_count_references().
|
static |
References country_table, and country_table::countryid.
Referenced by country_from_iso2(), and osm_process_town_unknown_country().
struct country_table* country_from_iso2 | ( | char * | iso | ) |
References country_from_countryid(), and country_id_from_iso2().
Referenced by process_boundaries_setup().
|
static |
References country_search_destroy(), country_search_get_item(), country_search_new(), item, item_attr_get(), attr::num, country_search::search, attr::str, attr::type, and attr::u.
Referenced by country_from_iso2().
|
inlinestatic |
Referenced by process_multipolygons_finish().
|
static |
References buffer::base, buffer::malloced, and buffer::malloced_step.
Referenced by allocate_node_item_in_buffer().
|
inlinestatic |
References ignore_unknown, and item_bin::type.
Referenced by osm_end_relation_multipolygon().
void flush_nodes | ( | int | final | ) |
References node_buffer, save_buffer(), buffer::size, slice_size, and slices.
Referenced by allocate_node_item_in_buffer(), and osm_read_input_data().
|
static |
References data.
Referenced by process_associated_streets(), and process_house_number_interpolations().
|
static |
References add_aux_tile(), filename, info, init_item(), item_bin_add_attr_int(), item_bin_add_attr_string(), item_bin_write(), and size.
Referenced by write_countrydir().
|
static |
References item_bin::clen, coord::x, and coord::y.
Referenced by process_multipolygons_find_loop().
References item_bin_get_nodeid(), item_bin_get_relationid(), item_bin_get_wayid(), and item_bin::type.
Referenced by tile_extend().
References item_bin_get_nodeid_from_attr().
Referenced by item_bin_get_id(), and itembin_warning().
|
static |
References item_bin_get_attr().
Referenced by item_bin_get_nodeid(), and process_house_number_interpolations_setup().
|
static |
References c, item_bin_get_nodeid(), item_bin_get_relationid(), item_bin_get_wayid(), osm_logv(), projection_mg, transform_to_geo(), and type.
Referenced by osm_process_towns().
void load_countries | ( | void | ) |
References bbox_extend(), c, item_bin::clen, country_table, country_table::countryid, filename, rect::h, item_bin::len, country_table::r, read_item(), and country_table::size.
Referenced by maptool_load_countries().
int map_resolve_coords_and_split_at_intersections | ( | FILE * | in, |
FILE * | out, | ||
FILE * | out_index, | ||
FILE * | out_graph, | ||
FILE * | out_coastline, | ||
int | final | ||
) |
References node_item::c, c, item_bin::clen, GET_REF, IS_REF, item_bin_get_wayid(), item_get_default_flags(), item_bin::len, node_item_get(), osm_warning(), processed_nodes, processed_nodes_out, processed_relations, processed_tiles, processed_ways, read_item(), node_item::ref_way, sig_alrm(), sig_alrm_end(), item_bin::type, and write_item_way_subsection().
Referenced by osm_resolve_coords_and_split_at_intersections().
|
static |
References buffer::base, node_item::nd_id, node_buffer, node_hash, and buffer::size.
Referenced by osm_add_node().
|
static |
References buffer::base, node_item::nd_id, node_buffer, node_count, and buffer::size.
Referenced by node_item_get().
References buffer::base, node_buffer, node_hash, and node_item_find_index_in_ordered_list().
Referenced by map_resolve_coords_and_split_at_intersections(), node_ref_way(), and resolve_ways().
|
static |
References node_item_get(), and node_item::ref_way.
Referenced by nodes_ref_item_bin().
|
static |
References c, item_bin::clen, GET_REF, and node_ref_way().
Referenced by osm_end_way(), and ref_ways().
void osm_add_member | ( | enum relation_member_type | type, |
osmid | ref, | ||
char * | role | ||
) |
References BUFFER_SIZE, item_bin_add_attr(), RELATION_MEMBER_PRINT_FORMAT, attr::str, tmp_item_bin, type, and attr::u.
Referenced by map_collect_data_osm_o5m(), parse_member(), and process_relation().
void osm_add_nd | ( | osmid | ref | ) |
References coord_buffer, coord_count, exit, MAX_COORD_COUNT, and SET_REF.
Referenced by map_collect_data_osm_o5m(), parse_nd(), and process_way().
void osm_add_node | ( | osmid | id, |
double | lat, | ||
double | lon | ||
) |
References allocate_node_item_in_buffer(), attr_strings_clear(), buffer::base, node_item::c, current_node, dbg_assert, debug_attr_buffer, id_last_node, in_node, is_in_buffer, lat, attr_bin::len, M_PI, M_PI_4, node_item::nd_id, node_buffer, node_buffer_to_hash(), node_hash, NODE_ID_BITS, node_is_tagged, nodeid, osmid_attr, osmid_attr_value, OSMID_FMT, node_item::ref_way, remove_last_node_item_from_buffer(), item::type, attr_bin::type, coord::x, and coord::y.
Referenced by map_collect_data_osm_o5m(), parse_node(), and process_dense().
void osm_add_relation | ( | osmid | id | ) |
References attr_strings_clear(), debug_attr_buffer, in_relation, iso_code, item_bin_add_attr_longlong(), item_bin_init(), osmid_attr_value, relation_type, and tmp_item_bin.
Referenced by map_collect_data_osm_o5m(), parse_relation(), and process_relation().
void osm_add_tag | ( | char * | k, |
char * | v | ||
) |
Sometimes there is no is_in tag, only is_in:country. I put this here so it can be overwritten by the previous if clause if there IS an is_in tag.
Ireland uses the place_county OSM tag to describe what county a town is in. This would be equivalent to is_in: Town; Locality; Country A real world example would be Node: Moycullen (52234625) The tag is processed as Moycullen; Galway; Ireland where Galway is the county
References access_value(), AF_BIKE, AF_CAR, AF_DANGEROUS_GOODS, AF_DELIVERY_TRUCK, AF_EMERGENCY_VEHICLES, AF_HIGH_OCCUPANCY_CAR, AF_HIGH_OCCUPANCY_CAR_ONLY, AF_HORSE, AF_MOPED, AF_MOTORCYCLE, AF_ONEWAY, AF_ONEWAYREV, AF_PEDESTRIAN, AF_PUBLIC_BUS, AF_ROUNDABOUT, AF_ROUNDABOUT_VALID, AF_SPEED_LIMIT, AF_TAXI, AF_THROUGH_TRAFFIC_LIMIT, AF_TOLL, AF_TRANSPORT_TRUCK, AF_UNDERGROUND, attr_debug_level, attr_string_county_name, attr_string_district_name, attr_string_email, attr_string_exit_to, attr_string_fax, attr_string_house_number, attr_string_label, attr_string_phone, attr_string_population, attr_string_postal, attr_string_ref, attr_string_street_destination, attr_string_street_destination_backward, attr_string_street_destination_forward, attr_string_street_name, attr_string_street_name_systematic, attr_string_street_name_systematic_int, attr_string_street_name_systematic_nat, attr_strings, attr_strings_save(), debug_attr_buffer, flagsa, in_relation, in_way, is_in_buffer, maxspeed_attr_value, node_is_tagged, osm_update_attr_present(), and relation_add_tag().
Referenced by map_collect_data_osm_o5m(), parse_tag(), and process_tag().
void osm_add_way | ( | osmid | id | ) |
References attr_strings_clear(), coord_count, debug_attr_buffer, flags_attr_value, flagsa, in_way, maxspeed_attr_value, osmid_attr_value, OSMID_FMT, item::type, way_hash, and wayid.
Referenced by map_collect_data_osm_o5m(), parse_way(), and process_way().
void osm_end_node | ( | struct maptool_osm * | osm | ) |
References attr_longest_match(), attr_longest_match_clear(), attr_mapping_node, attr_mapping_node_count, attr_string_county_name, attr_string_email, attr_string_exit_to, attr_string_fax, attr_string_house_number, attr_string_label, attr_string_phone, attr_string_population, attr_string_postal, attr_string_ref, attr_string_street_name, attr_string_url, attr_strings, node_item::c, current_node, dbg_assert, debug_attr_buffer, in_node, init_item(), is_in_buffer, item_bin_add_attr_longlong(), item_bin_add_attr_string(), item_bin_add_coord(), item_bin_set_type_by_population(), item_bin_write(), item_is_district, item_is_town, node_is_tagged, nodeid, maptool_osm::nodes, osmid_attr_value, OSMID_FMT, processed_nodes_out, maptool_osm::towns, item_bin::type, and types.
Referenced by map_collect_data_osm(), map_collect_data_osm_o5m(), and process_dense().
void osm_end_relation | ( | struct maptool_osm * | osm | ) |
References maptool_osm::associated_streets, attr_longest_match_clear(), in_relation, item_bin_write(), osm_end_relation_multipolygon(), relation_type, tmp_item_bin, maptool_osm::turn_restrictions, and item_bin::type.
Referenced by map_collect_data_osm(), map_collect_data_osm_o5m(), and process_relation().
|
inlinestatic |
References attr_longest_match(), attr_mapping_rel2poly_place, attr_mapping_rel2poly_place_count, attr_mapping_way, attr_mapping_way_count, attr_string_label, attr_strings, maptool_osm::boundaries, dbg_assert, filter_unknown(), item_bin_add_attr_int(), item_bin_add_attr_string(), item_bin_write(), maptool_osm::multipolygons, osmid_attr_value, OSMID_FMT, relation_type, tmp_item_bin, type, item_bin::type, and types.
Referenced by osm_end_relation().
void osm_end_way | ( | struct maptool_osm * | osm | ) |
References attr_longest_match(), attr_longest_match_clear(), attr_mapping_way, attr_mapping_way2poi, attr_mapping_way2poi_count, attr_mapping_way_count, attr_string_county_name, attr_string_district_name, attr_string_email, attr_string_fax, attr_string_house_number, attr_string_label, attr_string_phone, attr_string_street_destination, attr_string_street_destination_backward, attr_string_street_destination_forward, attr_string_street_name, attr_string_street_name_systematic, attr_string_street_name_systematic_nat, attr_string_url, attr_strings, coord_buffer, coord_count, dbg_assert, debug_attr_buffer, dedupe_ways_hash, flags_attr_value, flagsa, GET_REF, maptool_osm::house_number_interpolations, in_way, init_item(), item_bin_add_attr_int(), item_bin_add_attr_longlong(), item_bin_add_attr_string(), item_bin_add_coord(), item_bin_write(), item_get_default_flags(), maptool_osm::line2poi, maxspeed_attr_value, nodes_ref_item_bin(), osmid_attr_value, OSMID_FMT, maptool_osm::poly2poi, types, wayid, and maptool_osm::ways.
Referenced by map_collect_data_osm(), map_collect_data_osm_o5m(), and process_way().
void osm_info | ( | char * | type, |
osmid | id, | ||
int | cont, | ||
char * | fmt, | ||
... | |||
) |
References osm_logv(), and type.
Referenced by itembin_nicer_slicer(), and process_boundaries_setup().
void osm_init | ( | FILE * | rule_file | ) |
Referenced by maptool_init().
|
static |
References coord_geo::lat, coord_geo::lng, and OSMID_FMT.
Referenced by itembin_warning(), osm_info(), and osm_warning().
|
static |
Find country which town belongs to. Find town administrative hierarchy attributes.
in | bl list of administrative boundaries (data is struct boundary *) |
in | town item_bin structure holding town information |
in | c town center coordinates |
References boundary_find_matches(), c, match(), osm_process_town_by_boundary_update_attrs(), and town_country_list_insert_if_new().
Referenced by osm_process_towns().
|
static |
Update town attributes based on its administrative parents.
in | town town initial item_bin data |
in/out | tc town_country structure holding country information and town attributes to add to town item_bin |
in | matches list of administrative boundaries the town belongs to (data is struct boundary *) |
References boundary::admin_centre, country_table::admin_levels, town_country::attrs, town_country::country, boundary::ib, item_bin_get_attr(), name, nodeid, osm_tag_value(), attr::str, attr::type, item_bin::type, and attr::u.
Referenced by osm_process_town_by_boundary().
Find list of countries which town or district belongs to.
in | ib pointer to item_bin structure holding town information |
References country, country_table_hash, item_bin_get_attr(), and town_country_list_insert_if_new().
Referenced by osm_process_towns().
|
static |
Get town name from district is_in attribute if possible.
in | ib pointer to item_bin structure holding district information |
in | town_hash hash of all town names |
References item_bin_get_attr().
Referenced by osm_process_towns().
|
static |
References country_from_countryid(), town_country_new(), and unknown.
Referenced by osm_process_towns().
void osm_process_towns | ( | FILE * | in, |
FILE * | boundaries, | ||
FILE * | ways, | ||
char * | suffix | ||
) |
References town_country::attrs, bytes_read, c, town_country::country, country_table::countryid, country_table::file, free_boundaries(), item_bin_add_attr(), item_bin_dup(), item_bin_get_attr(), item_bin_remove_attr(), item_bin_write_match(), item_is_district, itembin_warning(), item_bin::len, MAX_TOWN_ADMIN_LEVELS, name, nodeid, osm_process_town_by_boundary(), osm_process_town_by_is_in(), osm_process_town_get_town_name_from_is_in(), osm_process_town_unknown_country(), osm_town_relations_to_poly(), process_boundaries(), processed_nodes, processed_nodes_out, processed_relations, processed_tiles, processed_ways, read_item(), sig_alrm(), sig_alrm_end(), attr::str, tempfile(), town_country_destroy(), attr::type, attr::u, and unknown_country.
Referenced by main().
|
static |
References boundary::children, coord_is_equal, geom_poly_segment::first, geom_poly_segment_type_way_outer, geom_poly_segment_type_way_unknown, boundary::ib, init_item(), item_bin_add_attr_longlong(), item_bin_add_attr_string(), item_bin_add_coord(), item_bin_write(), item_is_poly_place, geom_poly_segment::last, osm_tag_value(), boundary::sorted_segments, geom_poly_segment::type, and item_bin::type.
Referenced by osm_process_towns().
|
static |
References attr_hash, attr_present, attr_present_count, BUFFER_SIZE, dbg_assert, and p.
Referenced by osm_add_tag(), and relation_add_tag().
void osm_warning | ( | char * | type, |
osmid | id, | ||
int | cont, | ||
char * | fmt, | ||
... | |||
) |
References osm_logv(), and type.
Referenced by map_resolve_coords_and_split_at_intersections(), process_boundaries_finish(), process_boundaries_setup(), process_multipolygons_find_loops(), process_turn_restrictions_finish(), process_turn_restrictions_setup_one(), process_way2poi(), and relation_add_tag().
|
static |
References relation_member::id, RELATION_MEMBER_PARSE_FORMAT, relation_member::role, and relation_member::type.
Referenced by search_relation_member().
|
static |
void process_associated_streets | ( | FILE * | in, |
struct files_relation_processing * | files_relproc | ||
) |
References process_relation_member_func_priv::allocations, g_free_helper(), files_relation_processing::nodes2_in, files_relation_processing::nodes2_out, files_relation_processing::nodes_in, files_relation_processing::nodes_out, process_relation_member_func_priv::out, process_associated_streets_setup(), relations_destroy(), relations_new(), relations_process(), files_relation_processing::ways_in, and files_relation_processing::ways_out.
Referenced by main().
|
static |
References relation_member::id, item_bin_get_relationid(), name, associated_street::name, osm_tag_value(), process_relation_member_func_priv::out, process_associated_street_member(), read_item(), rel_member_way, relation_func_writethrough(), relations_add_relation_default_entry(), relations_add_relation_member_entry(), relations_func_new(), associated_street::relid, search_relation_member(), and relation_member::type.
Referenced by process_associated_streets().
|
static |
References process_relation_member_func_priv::allocations, house_number_interpolation::house_number_first_node, house_number_interpolation::house_number_last_node, item_bin_add_attr_string(), item_bin_get_attr(), item_bin_write(), nodeid, house_number_interpolation::nodeid_first_node, process_relation_member_func_priv::out, house_number_interpolation::street_name, and item_bin::type.
Referenced by process_house_number_interpolations_setup().
void process_house_number_interpolations | ( | FILE * | in, |
struct files_relation_processing * | files_relproc | ||
) |
References process_relation_member_func_priv::allocations, g_free_helper(), files_relation_processing::nodes2_in, files_relation_processing::nodes2_out, files_relation_processing::nodes_in, files_relation_processing::nodes_out, process_relation_member_func_priv::out, process_house_number_interpolations_setup(), relations_destroy(), relations_new(), relations_process(), files_relation_processing::ways_in, and files_relation_processing::ways_out.
Referenced by main().
|
static |
References dbg_assert, item_bin_get_nodeid_from_attr(), item_bin_get_wayid(), house_number_interpolation::nodeid_first_node, house_number_interpolation::nodeid_last_node, process_relation_member_func_priv::out, process_house_number_interpolation_member(), read_item(), rel_member_node, rel_member_way, relation_func_writethrough(), relations_add_relation_default_entry(), relations_add_relation_member_entry(), relations_func_new(), and house_number_interpolation::wayid.
Referenced by process_house_number_interpolations().
void process_multipolygons | ( | FILE * | in, |
FILE * | coords, | ||
FILE * | ways, | ||
FILE * | ways_index, | ||
FILE * | out | ||
) |
|
static |
References is_loop(), match(), and process_multipolygons_find_match().
Referenced by process_multipolygons_find_loops().
int process_multipolygons_find_loops | ( | osmid | relid, |
int | in_count, | ||
struct item_bin ** | parts, | ||
int ** | scount, | ||
int *** | sequences, | ||
int ** | direction | ||
) |
References osm_warning(), and process_multipolygons_find_loop().
Referenced by itembin_loop_combiner(), and process_multipolygons_finish().
|
static |
find the nect matching polygon segment This can be used to find the next matching "line" to form a polygon.
part | current line part |
part_used | how this part was used |
in_count | number of lines passed in parts @parts array of item_bin pointers giving the single parts @parts used int array, one for each part, indicating wheather the part was already used. This function sets the usage for the mathcing part if one is found. Usage is 0: not used, 1: used forward 2: used reverse |
References item_bin::clen, part, coord::x, and coord::y.
Referenced by process_multipolygons_find_loop().
|
static |
References bbox(), bbox_contains_coord(), item_bin::clen, dump_sequence(), multipolygon::inner, multipolygon::inner_count, item_bin_add_attr_data(), item_bin_add_coord(), item_bin_copy_attr(), item_bin_init(), item_bin_write(), multipolygon::outer, multipolygon::outer_count, process_multipolygons_find_loops(), process_multipolygons_loop_count(), process_multipolygons_loop_dump(), processed_relations, multipolygon::rel, multipolygon::relid, tmp_item_bin, and item_bin::type.
Referenced by process_multipolygons().
int process_multipolygons_loop_count | ( | struct item_bin ** | bin, |
int | scount, | ||
int * | sequence | ||
) |
get number of coordinates inside a sequence calculated by process_multipolygon_find_loop
bin | the array of all raw members of this multipolygon |
scount | number of members inside this sequence |
sequence | sequence calculated by process_multipolygon_find_loop |
References process_multipolygons_loop_dump().
Referenced by itembin_loop_combiner(), and process_multipolygons_finish().
int process_multipolygons_loop_dump | ( | struct item_bin ** | bin, |
int | scount, | ||
int * | sequence, | ||
int * | direction, | ||
struct coord * | buffer | ||
) |
References c, and item_bin::clen.
Referenced by itembin_loop_combiner(), process_multipolygons_finish(), and process_multipolygons_loop_count().
|
static |
References multipolygon::inner, multipolygon::inner_count, item_bin_dup(), item_bin_get_attr(), multipolygon::outer, multipolygon::outer_count, processed_ways, and type.
Referenced by process_multipolygons_setup().
|
static |
prepare multipolygon way matching
This function reads all multipolygon relations and prepares relations structures for later way matching. Since this scales quite ugly, (O^3) i think, we use multiple threads creating their own hash each. This way none of the hashes get's that big, and we can utilize more cpu power.
in | file containing the relations |
thread_count | number of threads to use |
relations | array of preallocated relations structures. One per thread. |
References item_bin_dup(), killer, process_multipolygon_setup_thread::multipolygons, process_multipolygon_setup_thread::number, process_multipolygons_member(), process_multipolygons_setup_worker(), process_multipolygon_setup_thread::queue, read_item(), process_multipolygon_setup_thread::relations, process_multipolygon_setup_thread::relations_func, relations_func_new(), process_multipolygon_setup_thread::thread, and thread_count.
Referenced by process_multipolygons().
|
static |
prepare one multipolygon relation for relattion processing
ib | the relation |
relations | the relation processing structure |
relations_func | function to use for the members |
multipolygons | write the resulting multipolygons to the list |
Referenced by process_multipolygons_setup_worker().
|
static |
multipolygons setup worker thread.
This thread processes any item passed to it via async queue into it's local relations function.
data | this threads local storage |
References data, killer, process_multipolygon_setup_thread::multipolygons, process_multipolygon_setup_thread::number, process_multipolygons_setup_one(), processed_relations, process_multipolygon_setup_thread::queue, process_multipolygon_setup_thread::relations, and process_multipolygon_setup_thread::relations_func.
Referenced by process_multipolygons_setup().
void process_turn_restrictions | ( | FILE * | in, |
FILE * | coords, | ||
FILE * | ways, | ||
FILE * | ways_index, | ||
FILE * | out | ||
) |
|
static |
References c, coord::x, and coord::y.
Referenced by process_turn_restrictions_finish().
|
static |
References turn_restriction::c, c, turn_restriction::c_count, item_bin_add_attr_range(), item_bin_add_coord(), item_bin_init(), item_bin_write(), turn_restriction::order, osm_warning(), overlap, process_turn_restrictions_dump_coord(), process_turn_restrictions_fromto(), processed_relations, turn_restriction::r, turn_restriction::relid, tile(), tmp_item_bin, and turn_restriction::type.
Referenced by process_turn_restrictions().
|
static |
References turn_restriction::c, c, turn_restriction::c_count, coord_is_equal, and type.
Referenced by process_turn_restrictions_finish().
|
static |
References bbox_extend(), turn_restriction::c, c, turn_restriction::c_count, item_bin::clen, rect::h, IS_REF, item_order_by_type(), turn_restriction::order, turn_restriction::r, type, and item_bin::type.
Referenced by process_turn_restrictions_setup().
|
static |
prepare turn restriction way matching
This function reads all turn restriction relations and prepares relations structures for later way matching. Since this scales quite ugly, (O^3) i think, we use multiple threads creating their own hash each. This way none of the hashes get's that big, and we can utilize more cpu power.
in | file containing the relations |
thread_count | number of threads to use |
relations | array of preallocated relations structures. One per thread. |
References item_bin_dup(), killer, process_turn_restrictions_setup_thread::number, process_turn_restrictions_member(), process_turn_restrictions_setup_worker(), process_turn_restrictions_setup_thread::queue, read_item(), process_turn_restrictions_setup_thread::relations, process_turn_restrictions_setup_thread::relations_func, relations_func_new(), process_turn_restrictions_setup_thread::thread, thread_count, and process_turn_restrictions_setup_thread::turn_restrictions.
Referenced by process_turn_restrictions().
|
static |
prepare one multipolygon relation for relattion processing
ib | the relation |
relations | the relation processing structure |
relations_func | function to use for the members |
turn_restrictions | write the resulting turn_restriction to the list |
References relation_member::id, item_bin_get_relationid(), turn_restriction::order, osm_types, osm_warning(), turn_restriction::r, rel_member_node, rel_member_way, relations_add_relation_member_entry(), turn_restriction::relid, search_relation_member(), item_bin::type, relation_member::type, and turn_restriction::type.
Referenced by process_turn_restrictions_setup_worker().
|
static |
turn restrictions setup worker thread.
This thread processes any item passed to it via async queue into it's local relations function.
data | this threads local storage |
References data, killer, process_turn_restrictions_setup_thread::number, process_turn_restrictions_setup_one(), processed_relations, process_turn_restrictions_setup_thread::queue, process_turn_restrictions_setup_thread::relations, process_turn_restrictions_setup_thread::relations_func, and process_turn_restrictions_setup_thread::turn_restrictions.
Referenced by process_turn_restrictions_setup().
void process_way2poi | ( | FILE * | in, |
FILE * | out, | ||
int | type | ||
) |
Get POI coordinates from area/line coordinates.
in | *in input file with area/line coordinates. |
in | *out output file with POI coordinates |
in | type input file original contents type: type_line or type_area |
References c, c1, c2, item_bin::clen, geom_line_middle(), geom_poly_centroid(), geom_poly_closest_point(), geom_poly_point_inside(), item_bin_get_wayid(), osm_warning(), read_item(), type, item_bin::type, and write_item_way_subsection().
Referenced by osm_process_way2poi().
void ref_ways | ( | FILE * | in | ) |
References nodes_ref_item_bin(), and read_item().
Referenced by osm_count_references().
|
static |
References attr_string_label, attr_strings_save(), iso_code, item_bin_add_attr_string(), osm_update_attr_present(), osm_warning(), osmid_attr_value, relation_type, tmp_item_bin, and item_bin::type.
Referenced by osm_add_tag().
|
static |
References item_bin_write().
Referenced by process_associated_streets_setup(), and process_house_number_interpolations_setup().
void remove_countryfiles | ( | void | ) |
References country_table, country_table::countryid, filename, country_table::nparts, country_table::size, and tempfile_unlink().
Referenced by maptool_assemble_map().
|
static |
References node_buffer, and buffer::size.
Referenced by osm_add_node().
void resolve_ways | ( | FILE * | in, |
FILE * | out | ||
) |
References node_item::c, c, item_bin::clen, GET_REF, IS_REF, item_bin_write(), node_item_get(), read_item(), coord::x, pcoord::x, coord::y, and pcoord::y.
Referenced by osm_count_references().
|
static |
References item_bin_get_attr(), parse_relation_member_string(), and relation_member::role.
Referenced by process_associated_streets_setup(), and process_turn_restrictions_setup_one().
void sort_countries | ( | int | keep_tmpfiles | ) |
References country_table, country_table::countryid, country_table::file, item_bin_sort_file(), country_table::r, country_table::size, and world_bbox.
Referenced by main().
|
static |
Referenced by osm_process_towns().
|
static |
Insert a new record into the list of town info structures, if there's no such entry.
in/out | town_country_list pointer to GList* of town_country structures. |
in | country country to add the town to |
References country, and town_country_new().
Referenced by osm_process_town_by_boundary(), and osm_process_town_by_is_in().
|
static |
References country, and town_country::country.
Referenced by osm_process_town_unknown_country(), and town_country_list_insert_if_new().
void write_countrydir | ( | struct zip_info * | zip_info, |
int | max_index_size | ||
) |
References ATTR_IS_STRING, country_table, country_table::countryid, filename, index_country_add(), item_bin_get_attr_bin(), item_bin_get_attr_bin_last(), item_bin_read(), item_bin_remove_attr(), item_bin_write(), key, item_bin::len, max, country_table::nparts, overlap, country_table::r, country_table::size, tempfile(), tempfile_name(), tile(), attr_bin::type, and zip_get_index().
Referenced by maptool_assemble_map().
|
static |
References c, item_bin::clen, dbg_assert, item_bin::len, processed_ways, item_bin::type, and write_item_way_subsection_index().
Referenced by map_resolve_coords_and_split_at_intersections(), and process_way2poi().
|
static |
References dbg_assert, item_bin_get_wayid(), and way_hash.
Referenced by write_item_way_subsection().
|
static |
Referenced by build_attrmap(), build_attrmap_line(), and osm_update_attr_present().
|
static |
Referenced by build_attrmap_line(), and osm_end_node().
|
static |
Referenced by build_attrmap_line(), and osm_end_node().
|
static |
Referenced by build_attrmap_line(), and osm_end_relation_multipolygon().
|
static |
Referenced by build_attrmap_line(), and osm_end_relation_multipolygon().
|
static |
Referenced by build_attrmap_line(), osm_end_relation_multipolygon(), and osm_end_way().
|
static |
Referenced by build_attrmap_line(), and osm_end_way().
|
static |
Referenced by build_attrmap_line(), and osm_end_way().
|
static |
Referenced by build_attrmap_line(), osm_end_relation_multipolygon(), and osm_end_way().
|
static |
Referenced by attr_longest_match(), attr_longest_match_clear(), build_attrmap(), and osm_update_attr_present().
|
static |
Referenced by attr_longest_match_clear(), build_attrmap(), build_attrmap_line(), and osm_update_attr_present().
char* attr_strings[attr_string_last] |
Referenced by attr_strings_clear(), attr_strings_save(), osm_add_tag(), osm_end_node(), osm_end_relation_multipolygon(), and osm_end_way().
char attr_strings_buffer[BUFFER_SIZE *16] |
Referenced by attr_strings_save().
int attr_strings_buffer_free_offset |
Referenced by attr_strings_clear(), and attr_strings_save().
|
static |
Referenced by build_attrmap(), and navit_get_search_results_map().
int boundary |
struct coord coord_buffer[MAX_COORD_COUNT] |
Referenced by osm_add_nd(), and osm_end_way().
int coord_count |
Referenced by osm_add_nd(), osm_add_way(), and osm_end_way().
struct country_table country_table[] |
Referenced by build_countrytable(), country_from_countryid(), load_countries(), remove_countryfiles(), sort_countries(), and write_countrydir().
|
static |
Referenced by build_countrytable(), and osm_process_town_by_is_in().
|
static |
The node currently being processed.
Referenced by osm_add_node(), and osm_end_node().
char debug_attr_buffer[BUFFER_SIZE] |
Referenced by osm_add_node(), osm_add_relation(), osm_add_tag(), osm_add_way(), osm_end_node(), and osm_end_way().
int flags[4] |
int flags_attr_value |
Referenced by osm_add_way(), and osm_end_way().
int flagsa[4] |
Referenced by osm_add_tag(), osm_add_way(), and osm_end_way().
osmid id_last_node |
ID of the last node processed.
Referenced by osm_add_node().
|
static |
Referenced by osm_add_node(), and osm_end_node().
|
static |
Referenced by osm_add_relation(), osm_add_tag(), and osm_end_relation().
|
static |
Referenced by osm_add_tag(), osm_add_way(), and osm_end_way().
char is_in_buffer[BUFFER_SIZE] |
Referenced by osm_add_node(), osm_add_tag(), and osm_end_node().
char iso_code[BUFFER_SIZE] |
Referenced by osm_add_relation(), and relation_add_tag().
Referenced by bookmarks_load_hash(), bookmarks_store_bookmarks_to_file(), country_id_from_iso2(), destination_address(), display_add(), do_draw(), Backend::get_bookmarks(), Backend::get_pois(), NGQProxyBookmarks::getBookmarks(), graphics_add_selection(), graphics_process_selection_item(), gui_gtk_bookmarks_update(), gui_gtk_destinations_update(), gui_internal_cmd_bookmarks(), gui_internal_cmd_delete_waypoint(), gui_internal_cmd_formerdests(), gui_internal_cmd_load_bookmarks_as_waypoints(), gui_internal_cmd_map_download_do(), gui_internal_cmd_pois(), gui_internal_cmd_pois_item(), gui_internal_cmd_position_do(), gui_internal_cmd_replace_bookmarks_from_waypoints(), gui_internal_cmd_view_attribute_details(), gui_internal_cmd_view_attributes(), gui_internal_cmd_view_in_browser(), gui_internal_create_resultlist_entry(), gui_internal_populate_route_table(), gui_internal_search_list_set_default_country(), gui_internal_select_waypoint(), item_coord_get_within_range(), item_hash_insert(), map_binfile_open(), map_dump_filedesc(), map_route_occluded_bbox(), map_route_occluded_get_buildings(), map_search_new_mg(), mapset_search_new(), model_poi(), navigation_get_attr(), navit_add_former_destinations_from_file(), navit_populate_search_results_map(), navit_speak(), navit_window_roadbook_update(), navit_zoom_to_route(), NGQProxySearch::NGQProxySearch(), osd_speed_warner_draw(), pedestrian_draw_arrows(), phase1_map(), popup_show_item(), quadtree_add(), read_former_destination_map_as_list(), route_find_nearest_street(), route_get_destination_description(), route_graph_add_street(), route_graph_add_traffic_distortion(), route_graph_add_turn_restriction(), route_graph_build_idle(), route_graph_set_traffic_distortion(), search_list_country_new(), search_list_house_number_new(), search_list_street_new(), search_list_town_new(), NGQProxyBookmarks::setPoint(), street_get_data(), street_search_get_item(), tm_dump_to_textfile(), tm_item_ref(), tm_item_unref(), tracking_doupdate_lines(), tracking_get_attr(), traffic_location_get_matching_points(), traffic_location_populate_route_graph(), traffic_message_add_segments(), traffic_message_restore_segments(), and traffic_point_match_segment_attributes().
|
static |
dummy memory location to pass a end condition to worker threads, as NULL cannot be passed.
Referenced by process_multipolygons_setup(), process_multipolygons_setup_worker(), process_turn_restrictions_setup(), and process_turn_restrictions_setup_worker().
int maxspeed_attr_value |
Referenced by osm_add_tag(), osm_add_way(), and osm_end_way().
GHashTable* node_hash |
Referenced by node_buffer_to_hash(), node_item_get(), and osm_add_node().
|
static |
Referenced by osm_add_node(), osm_add_tag(), and osm_end_node().
osmid nodeid |
char* osm_types[] = {"unknown","node","way","relation"} |
Referenced by process_turn_restrictions_setup_one().
struct attr_bin osmid_attr |
Referenced by osm_add_node().
long long osmid_attr_value |
Referenced by osm_add_node(), osm_add_relation(), osm_add_way(), osm_end_node(), osm_end_relation_multipolygon(), osm_end_way(), and relation_add_tag().
char relation_type[BUFFER_SIZE] |
Referenced by osm_add_relation(), osm_end_relation(), osm_end_relation_multipolygon(), and relation_add_tag().
GHashTable * way_hash |
Referenced by osm_add_way(), and write_item_way_subsection_index().
osmid wayid |
Referenced by ocean_tile(), osm_add_way(), and osm_end_way().