I have a query that give me the nearest roads to a point
SELECT osm_id, ref, name, way, ST_AsText(ST_Transform(way, 4326)), *
FROM planet_osm_roads
where
ST_DWithin(ST_Transform(ST_SetSrid(ST_Point(-1.28779, 51.78976), 4326), 3857), way, 20)
ORDER BY way <-> ST_Transform(ST_SetSrid(ST_Point(-1.28779, 51.78976), 4326), 3857) LIMIT 5;
Now I want in the same query to get for each road the nearest point(node) for my original point (-1.28779, 51.78976)
I know how to do it in separate queries, but for less DB access I want it in the same query.
Tn;x for any help
asked
05 Dec '18, 08:48
altopalo
53●8●10●13
accept rate:
0%