[pgrouting-users] pgrouting Dijkstra: non-vertex data routing
Daniel Kastl
daniel at georepublic.de
Thu Jul 23 03:03:17 PDT 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
>
> There are some good resources on anitagraser.com and this post
> shows how to associate a point (in this case airports) to the
> nearest network node and then solve the routing problem:
> http://anitagraser.com/2011/02/12/drive-time-isochrones/
>
Be aware that the blog post is relatively old and uses an outdated
version of pgRouting.
Also the function mentioned there does not limit the search area by
BBOX, so for large tables it might be slow(er).
It's better to use KNN to find nearest nodes, and you can find an
example in the workshop:
http://workshop.pgrouting.org/chapters/wrapper.html#route-between-lat-lon-points-and-return-ordered-geometry-with-heading
SELECT id::integer FROM ways_vertices_pgr
ORDER BY the_geom <-> ST_GeometryFromText(POINT(x y),4326) LIMIT 1;
Another option is to use TRSP function, because it does not require to
start from a node but can start from "within" an edge:
http://docs.pgrouting.org/2.0/en/src/trsp/doc/index.html#trsp
Best regards,
Daniel
- --
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.info
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJVsLvlAAoJEHjh5kk/zBG0hqkIAIHHkPt5E4XLuW9dASzdNlgH
N6GifNmVsA81hDT9k+wiNS85061rEfcryWKofsNqFJzoBPxEqr3w/N/zmYkKzF9f
mnfDEWNMeutULvMrA8jps8uGQ6iav+f7vLWO4jMDRskSfqUrFERnV1sZ7OHEV4Tt
4+8ICsv1hbJqF7Kk1R/VpYjGkbWTuf8b+uFvANMoL+Te6vaggGtngoB81kITPbO2
pdPt0F5XHFhNdjKxMfBoqsVqCfV1/8cTEI4wx+3EF0sdpjOmpEpm3OtTTPjD5+Dt
lzbWxlYM7yd2tOLY2QVBO6v+8jbHwpcg1/Pz3OWsFWVntef8T4NPm9jLNafUmwE=
=zApP
-----END PGP SIGNATURE-----
More information about the Pgrouting-users
mailing list