Skip to main content
deleted 61 characters in body
Source Link
PolyGeo
  • 65.5k
  • 29
  • 115
  • 353

UPDATE 1:

 

@Jendrusk: Thanks for your answer. YES, I am already using indexing. The columns id, source and target have BTREE index, whereas, geom_way column has gist type of index.

The query roughly takes 16ms. If you have any idea to optimize it further, I would be happy to know it. Thanks allot for the help. :)

UPDATE 1:

@Jendrusk: Thanks for your answer. YES, I am already using indexing. The columns id, source and target have BTREE index, whereas, geom_way column has gist type of index.

The query roughly takes 16ms. If you have any idea to optimize it further, I would be happy to know it. Thanks allot for the help. :)

 

@Jendrusk: I am already using indexing. The columns id, source and target have BTREE index, whereas, geom_way column has gist type of index.

The query roughly takes 16ms. If you have any idea to optimize it further, I would be happy to know it.

added 686 characters in body
Source Link
Amir
  • 113
  • 7

SOLUTION The first problem was with the projections. After solving it the problem was with the boundingbox. It was not big enough. The correct query is as below:

SELECT seq, id1 AS node, id2 AS edge, di.cost, ST_AsText(ST_Transform(geom_way, 4326)) FROM pgr_dijkstra('SELECT id, source, target, st_length(geom_way) as cost FROM hh_2po_4pgr WHERE geom_way && ST_MakeEnvelope(13.754883,45.636547,13.801408,45.647708, 4326)', 21000, 1855, false, false ) as di JOIN hh_2po_4pgr ON di.id2 = hh_2po_4pgr.id 

The query roughly takes 16ms. If you have any idea to optimize it further, I would be happy to know it. Thanks allot for the help. :)

SOLUTION The first problem was with the projections. After solving it the problem was with the boundingbox. It was not big enough. The correct query is as below:

SELECT seq, id1 AS node, id2 AS edge, di.cost, ST_AsText(ST_Transform(geom_way, 4326)) FROM pgr_dijkstra('SELECT id, source, target, st_length(geom_way) as cost FROM hh_2po_4pgr WHERE geom_way && ST_MakeEnvelope(13.754883,45.636547,13.801408,45.647708, 4326)', 21000, 1855, false, false ) as di JOIN hh_2po_4pgr ON di.id2 = hh_2po_4pgr.id 

The query roughly takes 16ms. If you have any idea to optimize it further, I would be happy to know it. Thanks allot for the help. :)

added 391 characters in body
Source Link
Amir
  • 113
  • 7

So far, I tried the following query:

select * FROM pgr_dijkstra('SELECT id, source, target, st_length(geom_way) as cost FROM hh_2po_4pgr WHERE geom_way && ST_MakeEnvelope(13.794389, 45.636805, 13.775791, 45.638375, 4326)', 21000, 1855, false, false ) as di 

This gives back an empty table and in result of this the whole query gives an emtpy table. Therefore, now the problem is in pgr_dijkstra() function. Without the boundingbox subquery is giving, it gives back results but with the wholeboundingbox query it gives back an empty table. I am looking in to JOIN and the outer query at the moment.

So now the boundingbox subquery is giving back results but the whole query gives back an empty table. I am looking in to JOIN and the outer query at the moment.

So far, I tried the following query:

select * FROM pgr_dijkstra('SELECT id, source, target, st_length(geom_way) as cost FROM hh_2po_4pgr WHERE geom_way && ST_MakeEnvelope(13.794389, 45.636805, 13.775791, 45.638375, 4326)', 21000, 1855, false, false ) as di 

This gives back an empty table and in result of this the whole query gives an emtpy table. Therefore, now the problem is in pgr_dijkstra() function. Without the boundingbox subquery, it gives back results but with the boundingbox query it gives back an empty table.

deleted 850 characters in body
Source Link
Amir
  • 113
  • 7
Loading
deleted 850 characters in body
Source Link
Amir
  • 113
  • 7
Loading
UPDATE1
Source Link
Amir
  • 113
  • 7
Loading
deleted 132 characters in body
Source Link
PolyGeo
  • 65.5k
  • 29
  • 115
  • 353
Loading
edited title
Link
whyzar
  • 12.1k
  • 23
  • 41
  • 72
Loading
Source Link
Amir
  • 113
  • 7
Loading