first time posting please ask for more details if not enough provided.
I am using OSM road data and have created postgres topology for them. I am now cleaning up the data before exporting it for network analysis.
I have encountered a problem that I am struggling to resolve for (the many) cases where a bridge goes over a road. In my topology a node has been created where they cross, but it is of course impossible to turn off a bridge on to the road underneath, so my network analysis will create incorrect routes.
In this example the node id is labelled in red and the edge id is labelled in white. For example on node 29, I need to prevent the possibility of routing along edge 43 -> edge 37. Also see node 22, this node must be preserved as edges 35 and 29 merge into edge 25, but it needs to be removed from edges 37 and 26 and replaced with one disconnected edge.
The roads have a 'layer' attribute associated to them (from OSM I believe) which ranges from -5 to 5, which might be used as a flag however I've struggled with it so far.
Also, each edge has a weight attribute that must be preserved in the final output. All I require as output is a CSV of n1, n2, weight.
The dataset is large (one country), and I'd prefer a solution in postgres, however I could explore other solutions in python, R etc.
It strikes me that this must be a common requirement when cleaning road data for network analysis but I've struggled to find any documented examples.