def write_spt(self, fp, spt, format="%(from)s:%(to)s:%(length)f:%(weight)d:%(points)s\n", 
                  reproject=True, point_delim=","):
        for edge in spt.edges:
            osmway = self.osm.ways[ edge.payload.name ]
            state = edge.to_v.payload
            if reproject:
                points = osmway.get_projected_points(self.projection)
            else:
                points = osmway.get_projected_points()
            length = edge.payload.length #osmway.length(osm.nodes)
            elapsed = state.time
            num_transfers = state.num_transfers
            
            fp.write( format % {'from':edge.from_v.label,
                                'to':edge.to_v.label,
                                'length':length,
                                'weight':state.weight,
                                'state':state,
                                'time':state.time,
                                'dist_walked':state.dist_walked,
                                'num_transfers':state.num_transfers,
                                'points':point_delim.join( [" ".join([str(c) for c in p]) for p in points] )} )
Writes out a shortest path tree.
dataset/ETHPy150Open bmander/graphserver/pygs/graphserver/ext/osm/graph.py/OSMGraph.write_spt