[postgis-users] order by st_distance

Guillaume LONGUETAUD mister.tefal at gmail.com
Mon Aug 9 03:47:12 PDT 2010


Hi !
I have a working query, which gives me roads crossed by a line between to
points, and I want to order these results by distance from the first point
to the roads.

select rue.* from troncons_routes rue where intersects(rue.the_geom,(select
makeline(a.the_geom, b.the_geom)
from points_toto a, points_toto b
where a.nom='Geocia' and b.nom = 'Gare SNCF'))
ORDER BY rue.nom_rue_g, st_distance(a.the_geom,rue.the_geom);

everything works fine, but the last part, where it seems to miss an entry at
the clause "from" for table 'a'  (that's what pgadmin's query editor says)
which I set up already.

Can someone help me, please ?

Hope you understand my question,
regards, Guillaume
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100809/19036428/attachment.html>


More information about the postgis-users mailing list