I have a table that contains the shortest path between destinations for survey respondents on an osm2po created network. When calculating the shortest path result, I store the geometry in a column. Now, using the same osm2po network table and each shortest path geometry, I am trying to determine whether the shortest path crosses or intersects a highway. I created another table that just contains the osm2po network with clazz 11-16 and run an st_intersects(shortestpathgeom,highwaygeom) and get all false results. The shortest path geometry is multilinestring and the highway geometry is linestring, both are SRID 4326 and have been created from the same table. Why am I getting no intersections? Here is a picture of the shortest path in purple, highway in green, osm2po in red.

shortestpath(purple), highway(green), network(red)

here is my code where po_routing.route is the shortest path, po_highway.the_geom is highway only network, and obstacle is the intersection test.

update analysis.po_routing 
set obstacle = st_intersects(route,b.the_geom)
from analysis.po_highway as b;

I don't understand why this fundamental function is not working as expected.

1 Answer 1


I seemed to have solved the problem by taking this approach:

1) perform create table highwaysinglegeom as select st_union(the_geom) from analysis.po_highway

2) perform the update query above using the single geometry highway table as the intersection layer rather than separate multilinestrings from my network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.