Closed thomas-fred closed 1 year ago
Suggest a thin wrapper over geopandas.GeoDataFrame.to_file
/ geopandas.read_file
with conventional layer names of nodes
and edges
for the two dataframes:
def to_file(network, fname):
network.nodes.to_file(fname, layer='nodes')
network.edges.to_file(fname, layer='edges')
def read_file(fname):
nodes = geopandas.read_file(fname, layer='nodes')
edges = geopandas.read_file(fname, layer='edges')
return Network(nodes, edges)
Yep that looks good to me. Maybe pass through kwargs to the geopandas methods, too?
It's a shame that parquet files don't seem to have a layer concept. I've been using them in open-gira, but having to write nodes and edges to separate files.
Closed by 4be5de2
Some way of serializing a network to and from disk?