navit
0.5.3-trunk
|
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "maptool.h"
#include "linguistics.h"
#include "file.h"
#include "debug.h"
Data Structures | |
struct | population_table |
Functions | |
int | item_bin_read (struct item_bin *ib, FILE *in) |
void | item_bin_set_type (struct item_bin *ib, enum item_type type) |
void | item_bin_init (struct item_bin *ib, enum item_type type) |
void | item_bin_add_coord (struct item_bin *ib, struct coord *coords_to_add, int count) |
void | item_bin_add_coord_reverse (struct item_bin *ib, struct coord *c, int count) |
void | item_bin_bbox (struct item_bin *ib, struct rect *r) |
void | item_bin_copy_coord (struct item_bin *ib, struct item_bin *from, int dir) |
void | item_bin_copy_attr (struct item_bin *ib, struct item_bin *from, enum attr_type attr) |
void | item_bin_add_coord_rect (struct item_bin *ib, struct rect *r) |
int | attr_bin_write_data (struct attr_bin *ab, enum attr_type type, void *data, int size) |
int | attr_bin_write_attr (struct attr_bin *ab, struct attr *attr) |
void | item_bin_add_attr_data (struct item_bin *ib, enum attr_type type, void *data, int size) |
void | item_bin_add_attr (struct item_bin *ib, struct attr *attr) |
void | item_bin_remove_attr (struct item_bin *ib, void *ptr) |
void | item_bin_add_attr_int (struct item_bin *ib, enum attr_type type, int val) |
void * | item_bin_get_attr (struct item_bin *ib, enum attr_type type, void *last) |
struct attr_bin * | item_bin_get_attr_bin (struct item_bin *ib, enum attr_type type, void *last) |
struct attr_bin * | item_bin_get_attr_bin_last (struct item_bin *ib) |
void | item_bin_add_attr_longlong (struct item_bin *ib, enum attr_type type, long long val) |
void | item_bin_add_attr_string (struct item_bin *ib, enum attr_type type, char *str) |
void | item_bin_add_attr_range (struct item_bin *ib, enum attr_type type, short min, short max) |
void | item_bin_add_hole (struct item_bin *ib, struct coord *coord, int ccount) |
add a "hole" to an item More... | |
void | item_bin_write (struct item_bin *ib, FILE *out) |
struct item_bin * | item_bin_dup (struct item_bin *ib) |
void | item_bin_write_clipped (struct item_bin *ib, struct tile_parameter *param, struct item_bin_sink *out) |
static char * | coord_to_str (struct coord *c) |
static void | dump_coord (struct coord *c, FILE *out) |
void | item_bin_dump (struct item_bin *ib, FILE *out) |
void | dump_itembin (struct item_bin *ib) |
void | item_bin_set_type_by_population (struct item_bin *ib, int population) |
void | item_bin_write_match (struct item_bin *ib, enum attr_type type, enum attr_type match, int maxdepth, FILE *out) |
static int | item_bin_sort_compare (const void *p1, const void *p2) |
int | item_bin_sort_file (char *in_file, char *out_file, struct rect *r, int *size) |
struct geom_poly_segment * | item_bin_to_poly_segment (struct item_bin *ib, int type) |
void | clip_line (struct item_bin *ib, struct rect *r, struct tile_parameter *param, struct item_bin_sink *out) |
void | clip_polygon (struct item_bin *ib, struct rect *r, struct tile_parameter *param, struct item_bin_sink *out) |
Variables | |
static struct population_table | town_population [] |
static struct population_table | district_population [] |
References attr_bin_write_data(), attr_data_get(), attr_data_size(), and attr::type.
Referenced by item_bin_add_attr().
References data, attr_bin::len, size, type, and attr_bin::type.
Referenced by attr_bin_write_attr(), and item_bin_add_attr_data().
void clip_line | ( | struct item_bin * | ib, |
struct rect * | r, | ||
struct tile_parameter * | param, | ||
struct item_bin_sink * | out | ||
) |
void clip_polygon | ( | struct item_bin * | ib, |
struct rect * | r, | ||
struct tile_parameter * | param, | ||
struct item_bin_sink * | out | ||
) |
Referenced by item_bin_write_clipped().
|
static |
References c, pcoord::x, and pcoord::y.
Referenced by dump_coord().
|
static |
References c, and coord_to_str().
Referenced by item_bin_dump().
void dump_itembin | ( | struct item_bin * | ib | ) |
Referenced by dump(), and write_item().
References attr_bin_write_attr(), ATTR_IS_GROUP, attr::attrs, item_bin::len, attr_bin::len, size, attr::type, attr_bin::type, and attr::u.
Referenced by index_init(), item_bin_add_attr_int(), item_bin_add_attr_longlong(), item_bin_add_attr_range(), item_bin_add_attr_string(), osm_add_member(), osm_process_towns(), and phase1_map().
References attr_bin_write_data(), data, item_bin::len, size, and type.
Referenced by ch_process_node(), item_bin_copy_attr(), and process_multipolygons_finish().
References item_bin_add_attr(), attr::num, attr::type, type, and attr::u.
Referenced by index_country_add(), index_submap_add(), osm_end_relation_multipolygon(), osm_end_way(), and write_tilesdir().
References item_bin_add_attr(), attr::num64, attr::type, type, and attr::u.
Referenced by ocean_tile(), osm_add_relation(), osm_end_node(), osm_end_way(), osm_town_relations_to_poly(), relations_process(), relations_process_multi(), and tile_collector_process_tile().
References item_bin_add_attr(), range::max, max, range::min, attr::range, attr::type, type, and attr::u.
Referenced by index_submap_add(), process_turn_restrictions_finish(), and write_tilesdir().
References item_bin_add_attr(), attr::str, attr::type, type, and attr::u.
Referenced by index_country_add(), item_bin_write_match(), itembin_write_slice_result(), osm_end_node(), osm_end_relation_multipolygon(), osm_end_way(), osm_town_relations_to_poly(), process_associated_street_member(), process_house_number_interpolation_member(), and relation_add_tag().
References item_bin::clen, and item_bin::len.
Referenced by ch_process_node(), clip_line(), close_polygon(), item_bin_add_coord_rect(), item_bin_add_coord_reverse(), item_bin_bbox(), item_bin_copy_coord(), osm_end_node(), osm_end_way(), osm_town_relations_to_poly(), phase1_map(), process_boundaries_finish(), process_multipolygons_finish(), process_turn_restrictions_finish(), relations_process(), relations_process_multi(), and tile_collector_process_tile().
References rect::h, and item_bin_add_coord().
Referenced by index_submap_add(), and write_tilesdir().
References c, and item_bin_add_coord().
add a "hole" to an item
This function adds a "hole" (attr_poly_hole) to a map item. It adds the coordinates and the coordinate count to the existing item. WARNING: It does NOT allocate any memory, so the memory after the item must be already allocated for that purpose.
[in,out] | ib | item - to add hole to |
[in] | coord | - hole coordinate array |
[in] | ccount | - number of coordinates in coord |
References item_bin::len, and attr::type.
Referenced by itembin_write_slice_result().
References c, rect::h, item_bin_add_coord(), coord::x, pcoord::x, coord::y, and pcoord::y.
Referenced by ocean_tile(), and tile_collector_process_tile().
References item_bin_add_attr_data(), item_bin_get_attr_bin(), attr_bin::len, and attr_bin::type.
Referenced by clip_line(), and process_multipolygons_finish().
References c, item_bin::clen, and item_bin_add_coord().
void item_bin_dump | ( | struct item_bin * | ib, |
FILE * | out | ||
) |
References attr_data_set(), attr_to_name(), attr_to_text(), c, item_bin::clen, dump_coord(), item_to_name(), item_bin::len, attr_bin::len, attr::str, attr::type, item_bin::type, and attr_bin::type.
References item_bin::len.
Referenced by osm_process_towns(), process_boundaries_setup(), process_multipolygons_member(), process_multipolygons_setup(), and process_turn_restrictions_setup().
References item_bin::clen, item_bin::len, attr_bin::len, type, and attr_bin::type.
Referenced by boundary_relid(), item_bin_get_nodeid_from_attr(), item_bin_get_relationid(), item_bin_get_wayid(), item_bin_write_match(), itembin_nicer_slicer(), osm_process_town_by_boundary_update_attrs(), osm_process_town_by_is_in(), osm_process_town_get_town_name_from_is_in(), osm_process_towns(), osm_tag_value(), process_associated_street_member(), process_boundaries_member(), process_boundaries_setup(), process_house_number_interpolation_member(), process_multipolygons_member(), relations_process(), relations_process_multi(), and search_relation_member().
References item_bin::clen, item_bin::len, attr_bin::len, type, and attr_bin::type.
Referenced by item_bin_copy_attr(), item_bin_sort_compare(), itembin_disassemble(), phase34_process_file(), and write_countrydir().
References item_bin::clen, item_bin::len, and attr_bin::len.
Referenced by item_bin_sort_compare(), and write_countrydir().
int item_bin_read | ( | struct item_bin * | ib, |
FILE * | in | ||
) |
References item_bin::len.
Referenced by read_item(), and write_countrydir().
void item_bin_remove_attr | ( | struct item_bin * | ib, |
void * | ptr | ||
) |
References item_bin::clen, item_bin::len, and attr_bin::len.
Referenced by item_bin_write_match(), osm_process_towns(), and write_countrydir().
References type, and item_bin::type.
Referenced by item_bin_init(), and item_bin_set_type_by_population().
void item_bin_set_type_by_population | ( | struct item_bin * | ib, |
int | population | ||
) |
References district_population, item_bin_set_type(), item_is_district, population_table::population, town_population, and type.
Referenced by osm_end_node().
|
static |
References item_bin_get_attr_bin(), item_bin_get_attr_bin_last(), linguistics_casefold(), s1, and attr_bin::type.
Referenced by item_bin_sort_file().
int item_bin_sort_file | ( | char * | in_file, |
char * | out_file, | ||
struct rect * | r, | ||
int * | size | ||
) |
References bbox_extend(), c, item_bin::clen, dbg_assert, file_get_contents(), rect::h, item_bin_sort_compare(), item_bin::len, p, and size.
Referenced by sort_countries().
struct geom_poly_segment* item_bin_to_poly_segment | ( | struct item_bin * | ib, |
int | type | ||
) |
References item_bin::clen, geom_poly_segment::first, geom_coord_copy(), geom_poly_segment::last, geom_poly_segment::type, and type.
Referenced by process_boundaries_member(), and tile_data_to_segments().
void item_bin_write | ( | struct item_bin * | ib, |
FILE * | out | ||
) |
References dbg_assert, and item_bin::len.
Referenced by ch_process_node(), file_writer_process(), index_country_add(), index_init(), item_bin_write_match(), osm_end_node(), osm_end_relation(), osm_end_relation_multipolygon(), osm_end_way(), osm_town_relations_to_poly(), phase1_map(), process_associated_street_member(), process_binfile(), process_boundaries_finish(), process_house_number_interpolation_member(), process_multipolygons_finish(), process_turn_restrictions_finish(), relation_func_writethrough(), resolve_ways(), write_countrydir(), and write_tilesdir().
void item_bin_write_clipped | ( | struct item_bin * | ib, |
struct tile_parameter * | param, | ||
struct item_bin_sink * | out | ||
) |
References bbox(), tile_data::buffer, item_bin::clen, clip_line(), clip_polygon(), tile_data::item_bbox, item_bin_write_to_sink(), tile_parameter::max, tile_parameter::min, tile_parameter::overlap, tile(), tile_bbox(), tile_data::tile_bbox, tile_data::tile_depth, and item_bin::type.
Referenced by clip_line(), and coastline_processor_process().
void item_bin_write_match | ( | struct item_bin * | ib, |
enum attr_type | type, | ||
enum attr_type | match, | ||
int | maxdepth, | ||
FILE * | out | ||
) |
References bbox_extend(), c, item_bin::clen, rect::h, item_bin_add_attr_string(), item_bin_get_attr(), item_bin_remove_attr(), item_bin_write(), item_bin::len, linguistics_expand_special(), linguistics_next_word(), linguistics_search(), match(), overlap, tile(), and type.
Referenced by osm_process_towns().
|
static |
Referenced by item_bin_set_type_by_population().
|
static |
Referenced by item_bin_set_type_by_population().