[postgis-users] order by st_distance

William Furnass will at thearete.co.uk
Mon Aug 9 04:30:22 PDT 2010


You might need to insert ', points_toto a, points_toto b' after 'from
troncons_routes'.

Will

On 9 August 2010 11:47, Guillaume LONGUETAUD <mister.tefal at gmail.com> wrote:
> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>



More information about the postgis-users mailing list