2 * Hic Est Leo -- Main Program
4 * (c) 2014--2015 Martin Mares <mj@ucw.cz>
21 uns debug_dump_source, debug_dump_after_proj, debug_dump_after_scaling;
22 uns debug_dump_multipolygons, debug_dump_css, debug_dump_styling, debug_dump_symbols;
24 static struct cf_section debug_cf = {
26 CF_UNS("DumpSource", &debug_dump_source),
27 CF_UNS("DumpAfterProj", &debug_dump_after_proj),
28 CF_UNS("DumpAfterScaling", &debug_dump_after_scaling),
29 CF_UNS("DumpMultipolygons", &debug_dump_multipolygons),
30 CF_UNS("DumpCSS", &debug_dump_css),
31 CF_UNS("DumpStyling", &debug_dump_styling),
32 CF_UNS("DumpSymbols", &debug_dump_symbols),
37 static const struct opt_section options = {
39 OPT_HELP("Hic Est Leo -- Experimental Map Renderer"),
48 int main(int argc UNUSED, char **argv)
50 cf_def_file = "map.cf";
51 cf_declare_section("Debug", &debug_cf, 0);
52 opt_parse(&options, argv+1);
60 struct svg *svg = svg_open(map_svg_output);
63 svg_set_attr_dimen(svg, "width", page_width);
64 svg_set_attr_dimen(svg, "height", page_height);
68 svg_set_attr_dimen(svg, "width", page_height);
69 svg_set_attr_dimen(svg, "height", page_width);
74 map_apply_styles(svg);
78 svg_push_element(svg, "defs");
79 svg_push_element(svg, "clipPath");
80 svg_set_attr(svg, "id", "boundary");
82 svg_path_move_to(svg, page_offset_x, page_offset_y);
83 svg_path_line_to_rel(svg, page_map_width, 0);
84 svg_path_line_to_rel(svg, 0, page_map_height);
85 svg_path_line_to_rel(svg, -page_map_width, 0);
92 svg_push_element(svg, "g");
93 svg_set_attr_format(svg, "clip-path", "url(#boundary)");
95 svg_set_attr_format(svg, "transform", "translate(%.6g,0) rotate(90)", page_height * svg->scale);
105 svg_push_element(svg, "rect");
106 svg_set_attr_dimen(svg, "x", page_offset_x);
107 svg_set_attr_dimen(svg, "y", page_offset_y);
108 svg_set_attr_dimen(svg, "width", page_map_width);
109 svg_set_attr_dimen(svg, "height", page_map_height);
110 svg_set_attr(svg, "fill", "none");
111 svg_set_attr(svg, "stroke", "blue");
112 svg_set_attr_dimen(svg, "stroke-width", 0.2);
118 msg(L_INFO, "Finished");