def METHOD_NAME(self, outfile):
    out = open(outfile, 'w')
    for node_id, node_props, ways in self.intersections():
        d = {'id': safe_encode(node_id),
             'node': node_props,
             'ways': ways}
        out.write(json.dumps(d) + six.u('\n'))