I've got graphs of Berlin on January 1, 2020 and January 1, 2021, but how do I compare the changes of edges and nodes in the two maps?
import osmnx as ox
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
from itertools import combinations
from IPython.display import clear_output
import matplotlib.cm as cm
import matplotlib.colors as colors
from IPython.display import Image
Getting the network of Berlin in 2021-01-01.
ox.utils.config(overpass_settings='[out:json][timeout:180][date:"2021-01-01T00:00:00Z"]')
G_21=ox.graph.graph_from_place('Berlin,Germany', network_type='all_private', simplify=True, retain_all=True, truncate_by_edge=False,which_result=None, buffer_dist=None, clean_periphery=True,custom_filter='["highway"~"cycleway|path|living_street"]["bicycle"!~"no"]')
fig, ax = ox.plot_graph(G_21,node_size=1,edge_linewidth=0.5)
Getting the network of Berlin in 2020-01-01
ox.utils.config(overpass_settings='[out:json][timeout:180][date:"2020-01-01T00:00:00Z"]')
G_20=ox.graph.graph_from_place('Berlin,Germany', network_type='all_private', simplify=True, retain_all=True, truncate_by_edge=False,which_result=None, buffer_dist=None, clean_periphery=True,custom_filter='["highway"~"cycleway|path|living_street"]["bicycle"!~"no"]')
fig, ax = ox.plot_graph(G_20,node_size=1,edge_linewidth=0.5)
Now I wonder how to identify the changes of nodes and edges, then mark the added ones in G_21 and deleted ones in G_20.