X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=leo.c;h=5d02f680a90c6e84fe69954e5e32bbf73a2df4d7;hb=69501dc691564f350581115ee49d61ef39858e62;hp=c873770b05e34387a0f4da5f886ceda76447e77a;hpb=a732e5a272c5a1a30abc8c8f830583c75f334b96;p=leo.git diff --git a/leo.c b/leo.c index c873770..5d02f68 100644 --- a/leo.c +++ b/leo.c @@ -118,37 +118,9 @@ int main(int argc UNUSED, char **argv) osm_init(); styles_init(); - - msg(L_INFO, "Parsing OSM"); - osm_xml_parse(map_xml_input); - if (debug_dump_source) - { - puts("=== Source data ==="); - osm_dump(); - } - osm_make_multipolygons(); - - msg(L_INFO, "Projecting"); - osm_project(map_projection); - if (debug_dump_after_proj) - { - puts("=== Map after projection ==="); - osm_dump(); - } - + map_load_styles(); + map_load_sources(); map_set_scale(); - if (debug_dump_after_scaling) - { - puts("=== Map after scaling ==="); - osm_dump(); - } - - struct css_sheet *ss = css_load(map_style_sheet); - if (debug_dump_css) - { - puts("=== Stylesheet ==="); - css_dump(ss); - } struct svg *svg = svg_open(map_svg_output); if (!map_rotate) @@ -162,32 +134,9 @@ int main(int argc UNUSED, char **argv) svg_set_attr_dimen(svg, "height", page_width); } - struct style_results r; - style_init(&r); sym_init(); - msg(L_INFO, "Applying stylesheet"); - for (uns i = OSM_TYPE_NODE; i <= OSM_TYPE_MULTIPOLYGON; i++) - CLIST_FOR_EACH(struct osm_object *, o, osm_obj_list[i]) - { - if (debug_dump_styling) - { - puts("==============================="); - osm_obj_dump(o); - } - if (!map_object_visible_p(o)) - { - if (debug_dump_styling) - printf("--> invisible\n"); - continue; - } - style_begin(&r, o); - css_apply(ss, &r); - if (debug_dump_styling) - style_dump(&r); - sym_from_style(o, &r, svg); - style_end(&r); - } + map_apply_styles(svg); if (map_clip) { @@ -212,11 +161,14 @@ int main(int argc UNUSED, char **argv) } // FIXME: Replace by generic logo drawing facility +#if 0 struct svg_icon *logo = svg_icon_load(svg, "../logo/kocka-s-okrajem.svg"); +#endif sym_draw_all(svg); // Draw logo +#if 0 double logo_width = 36.12; double logo_height = 36.12 / logo->width * logo->height; struct svg_icon_request sir = { @@ -227,6 +179,7 @@ int main(int argc UNUSED, char **argv) .height = logo_height, }; svg_icon_put(svg, &sir); +#endif draw_scale(svg);