def main(gviz_path, layer_only=False):

    graphviz_setup(gviz_path)
    graph = pydot.Dot(graph_type='digraph', rankdir="TB")

    layer_children = {
            'CLASS': {
                'LABEL': {'STYLE': {}},
                'CONNECTIONOPTIONS': {},
                'LEADER': {'STYLE': {}},
                'STYLE': {},
                'VALIDATION': {}
            },
            'CLUSTER': {},
            'COMPOSITE': {},
            'FEATURE': {'POINTS': {}},
            'GRID': {},
            'JOIN': {},
            'METADATA': {},
            'PROJECTION': {},
            'SCALETOKEN': {'VALUES': {}},
            'VALIDATION': {}
     }

    # pprint.pprint(layer_children)

    classes = {
        "MAP": {
            "LAYER": layer_children,
            'LEGEND': {'LABEL': {}},
            'PROJECTION': {},
            'QUERYMAP': {},
            'REFERENCE': {},
            'SCALEBAR': {'LABEL': {}},
            'SYMBOL': {},
            'WEB': {'METADATA': {}, 'VALIDATION': {}}
        }
     }

    if layer_only:
        root = "LAYER"
        classes = classes["MAP"]
        fn = "layer_classes"
    else:
        fn = "map_classes"
        root,  = classes.keys()

    node = pydot.Node(root, style="filled", fillcolor="#33a333", label=root, fontname=FONT, shape="polygon")
    graph.add_node(node)
    add_children(graph, root, classes[root])
    save_file(graph, fn)