I'm very new to GIS and to pgRouting. We're implementing a Routing system in our app and we need to route between points that we'll define ourself.

So far, we have a working pgRouting on Postgis (on Postgres) and a Spring boot application to call pgRouting's methods. We managed somehow to download from Geofabrik and import OSM files into the running database using osmttools to reduce it's size, but there still are way too much points and it takes too much time to proceed a pgr_dijkstra call.

Now, during the import phase, I need a way to remove all points and leave only those we're.


My understanding of PGRouting is that when you create a network from a line dataset, it will build a 'ways' table, but most importantly build a 'osm_nodes' table from the nodes of the 'ways'.

The actual routing takes place from node to node, and it sounds like here you have way too many nodes in the osm_nodes table.

I would suggest truncating (removing all) features from the osm_nodes table (create a backup just in case), and using an INSERT to load your preferred nodes into the osm_nodes table (using INSERT will let you map existing columns to the osm_nodes columns).

From there, it will now only use the nodes you have loaded to find any routes.

(note: I think you didn't finish the last sentence in your question...?)

| improve this answer | |
  • Good. It's the same idea that I was already applying. Thank you very much! – Selast Lambou Jul 14 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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