3

One thing that sometimes works is to rewrite a series of OR conditions into a sequence of UNIONs: CREATE TABLE restriction AS SELECT '100' as to_cost, a.nextedge as target_id, a.currentedge as via_path FROM adjacency a JOIN adjacency b ON a.nextedge = b.currentedge WHERE a.sourcenode = b.sourcenode AND (a.degrees < 45.0 OR a.degrees > 315.0) UNION ...


1

Maybe this will help start you out but here is how I am thinking through this. I can't think of any case, re spherical trig where two straight lines would be closer in the middle than at the edges, unless they cross so I think you can narrow your search down to the vertices of each road plus the nearest point to that vertex on the other road. I am assuming ...


Only top voted, non community-wiki answers of a minimum length are eligible