Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 05 20:04
    cvvergara review_requested #1771
  • Dec 05 20:04
    cvvergara review_requested #1771
  • Dec 05 20:04
    cvvergara review_requested #1771
  • Dec 05 20:04
    cvvergara ready_for_review #1771
  • Dec 05 20:03
    cvvergara commented #1771
  • Dec 05 19:11
    cvvergara commented #1771
  • Dec 05 19:09
    cvvergara synchronize #1771
  • Dec 05 18:56
    cvvergara synchronize #1771
  • Dec 05 18:49
    cvvergara edited #1770
  • Dec 05 18:42
    cvvergara synchronize #1771
  • Dec 05 18:38
    cvvergara synchronize #1771
  • Dec 05 18:08

    krashish8 on develop

    [bdAstar][sql] Added Combinatio… [bdAstarCost][sql] Added Combin… [bdAstar] Updated v3.2 signatur… and 9 more (compare)

  • Dec 05 18:08
    krashish8 closed #1774
  • Dec 05 17:27
    omshinde commented #1774
  • Dec 05 17:27
    omshinde commented #1774
  • Dec 05 17:27
    omshinde commented #1774
  • Dec 05 17:27
    cvvergara commented #1774
  • Dec 05 17:26
    omshinde commented #1774
  • Dec 05 17:26
    omshinde commented #1774
  • Dec 05 17:26
    omshinde commented #1774
Rajat Shinde
@omshinde
Sure. Thank you, that will be helpful!
Vicky Vergara
@cvvergara
Please merge
Rebase & merge is better
Rajat Shinde
@omshinde
Ahh, I had already merged. Rebase & Merge could have been a better option.
Vicky Vergara
@cvvergara
Yes that way there is no empty commit (the merge commit)
Ok, I will try to do the TODO & fix what needs to be fixed to make it pass the actions
We still have 3 minutes :-)
Rajat Shinde
@omshinde
Sure. Will keep that in mind from next time.
Sure.
Vicky Vergara
@cvvergara
I left the images one alive, so that when you have time please keep updating images
Rajat Shinde
@omshinde
Would Tuesday be possible to meet next? I will try to update more images by then
Vicky Vergara
@cvvergara
Tuesday is fine fore me. You ping me
Rajat Shinde
@omshinde
Sure. Thank you very much! :)
Vicky Vergara
@cvvergara
Roberto Rejano Arias
@Roberto1993_gitlab
Hi Vicky, Roberto from Barcelona speaking (Spain). I watched some of your useful videos talking about pgrouting. I was wondering, after been searching a lot (forums, books, videos and so on), if you would be kind to share a simple example of showing the salesman problem sql sentence (I work in Pgadmin4)... I have used pgr_tsp with pgr_dijkstra matrix, but I think I miss a geometry of the route there
I use Pgadmin4*
Rajat Shinde
@omshinde
Hi @cvvergara . I am really sorry, we will have to shift our today's meet. I have a meeting today regarding a submission in the evening and because of that won't be able to join our call. Sorry for the inconvenience. :)
Vicky Vergara
@cvvergara
@omshinde ok
Vicky Vergara
@cvvergara

@Roberto1993_gitlab From the documentation

SELECT * FROM pgr_TSP(
    $$
    SELECT * FROM pgr_dijkstraCostMatrix(
        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
        (SELECT array_agg(id) FROM edge_table_vertices_pgr WHERE id < 14),
        directed := false)
    $$,
    randomize := false);

You need to find the edges of that route defined with vertices: 1-4-9-12-11-13-10-5-7-8-6-3-2-1
You can use pgr_dijkstra(combinations)

WITH d AS (
 SELECT * FROM pgr_dijkstra('SELECT * FROM edge_table',
  $combinations$
   WITH tsp AS (SELECT * FROM pgr_TSP(
      $$
      SELECT * FROM pgr_dijkstraCostMatrix(
        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
        (SELECT array_agg(id) FROM edge_table_vertices_pgr WHERE id < 14),
        directed := false)
    $$,
    randomize := false)),
    info AS (SELECT node as source, lead(node) OVER (ORDER BY seq) as target FROM tsp)
    SELECT * FROM info WHERE target IS NOT NULL 
  $combinations$
, directed => false)
)
SELECT d.*, the_geom FROM d
   JOIN edge_table ON(edge = id);
The combinations inner query:
WITH tsp AS (SELECT * FROM pgr_TSP(
      $$
      SELECT * FROM pgr_dijkstraCostMatrix(
        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
        (SELECT array_agg(id) FROM edge_table_vertices_pgr WHERE id < 14),
        directed := false)
    $$,
    randomize := false)),
    info AS (SELECT node as source, lead(node) OVER (ORDER BY seq) as target FROM tsp)
    SELECT * FROM info WHERE target IS NOT NULL;
 source | target 
--------+--------
      1 |      4
      4 |      9
      9 |     12
     12 |     11
     11 |     13
     13 |     10
     10 |      5
      5 |      7
      7 |      8
      8 |      6
      6 |      3
      3 |      2
      2 |      1
(13 rows)
Vicky Vergara
@cvvergara
So you are getting the geometries, because once you find the order from tsp you need to find the path
SELECT a.seq, the_geom FROM pgr_dijkstraVia('SELECT * FROM edge_table', (SELECT array_agg(node ORDER BY seq) FROM pgr_TSP(
    $$
    SELECT * FROM pgr_dijkstraCostMatrix(
        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
        (SELECT array_agg(id) FROM edge_table_vertices_pgr WHERE id < 14),
        directed := false)
    $$,
    randomize := false)), false) a JOIN edge_table ON (edge=id);
Vicky Vergara
@cvvergara
So, remember that pgRouitng is about graphs, graphs in general do not care about geometries, because many applications care about geometries you need to do postgres + postGIS wrappers that get what you need
Maybe you want to have a look at this http://talks.vicky.georepublic.info/2020/qgis_latam.html
has the basics on handling pgRouting + geometries
Roberto Rejano Arias
@Roberto1993_gitlab
Oh that really worked! Thanks Vicky, it's being a long road since I started studying how I would get the route itself
Vicky Vergara
@cvvergara
@omshinde @krashish8 Hi
Ashish Kumar
@krashish8
Hi @cvvergara
Vicky Vergara
@cvvergara
Hey Ashish
Ashish Kumar
@krashish8
Please review pgRouting/pgrouting#1774
Oh, you already did that. Can I rebase and merge?
Vicky Vergara
@cvvergara
I just approved, But lets wait a little for @omshinde I would like him to review also
Ashish Kumar
@krashish8
Yeah, okay
Vicky Vergara
@cvvergara
@iosefa Hello, are you around?
@krashish8 Today we are going to have a special meeting with @iosefa
while he comes let me talk to you about pgRouting/pgrouting#1771
Its a draft PR, but I will have to back port a lot of code changes to 3.0
I am also keeping this other draft PR: pgRouting/pgrouting#1765
Where I am gathering all the bug fixes I am making
so to move them to 3.2-dev
Ashish Kumar
@krashish8
Sorry to interrupt. I'll be back in 15 mins. While he comes, I'll have dinner.
Vicky Vergara
@cvvergara
perfect I will go get my coffee
Ashish Kumar
@krashish8
I'm back!
Vicky Vergara
@cvvergara
I am back also
@iosefa hasnt seen my message on wahts, maybe he is already sleeping
so lets jitsi
Vicky Vergara
@cvvergara
Vicky Vergara
@cvvergara
rm -rf ./* ; CXX=clang++ CC=clang cmake -DCMAKE_BUILD_TYPE=Debug ..; make
Vicky Vergara
@cvvergara
Vicky Vergara
@cvvergara