3

I use the sql below it returns me several geom_way:

SELECT St_astext(geom)FROM pgr_fromAtoB('ways',-51.1995,-30.0487604,-51.2157942,-30.0469069);

Return:

LINESTRING(-51.1995 -30.0487604,-51.2010166 -30.0495917)
LINESTRING(-51.2010166 -30.0495917,-51.2025687 -30.0503647)
LINESTRING(-51.2025687 -30.0503647,-51.2038761 -30.0510814)
LINESTRING(-51.2038761 -30.0510814,-51.2052346 -30.0517926)
LINESTRING(-51.2052346 -30.0517926,-51.2053382 -30.0517299,-51.2055086 -30.0514995)
LINESTRING(-51.2055086 -30.0514995,-51.2065542 -30.052029)
LINESTRING(-51.2065542 -30.052029,-51.2070887 -30.0518558,-51.2074272 -30.0517254)
LINESTRING(-51.2074272 -30.0517254,-51.2081763 -30.0514558)
LINESTRING(-51.2081763 -30.0514558,-51.208337 -30.0513539,-51.20844 -30.0512648,-51.2085687 -30.0511236,-51.2088256 -30.0507909,-51.2090106 -30.0505536)
LINESTRING(-51.2090106 -30.0505536,-51.2098613 -30.0494869,-51.2100104 -30.0494252)
LINESTRING(-51.2100104 -30.0494252,-51.2102327 -30.0494958,-51.2108592 -30.0498549)
LINESTRING(-51.2108592 -30.0498549,-51.2116327 -30.0494558)
LINESTRING(-51.2116327 -30.0494558,-51.2130232 -30.0486757)
LINESTRING(-51.2130232 -30.0486757,-51.2133473 -30.048497)
LINESTRING(-51.2133473 -30.048497,-51.2134741 -30.0478809,-51.2135209 -30.0477931)
LINESTRING(-51.2135209 -30.0477931,-51.2136382 -30.0478068)
LINESTRING(-51.2136382 -30.0478068,-51.2136545 -30.0477302,-51.2136611 -30.0476998)
LINESTRING(-51.2136611 -30.0476998,-51.2137138 -30.047454)
LINESTRING(-51.2137138 -30.047454,-51.2137818 -30.047341)
LINESTRING(-51.2137818 -30.047341,-51.213891 -30.0473541,-51.2147429 -30.0474634)
LINESTRING(-51.2147429 -30.0474634,-51.214929 -30.0467988)
LINESTRING(-51.214929 -30.0467988,-51.2157942 -30.0469069)

I try:

SELECT ST_Union(St_astext(geom))FROM pgr_fromAtoB('ways',-51.1995,-30.0487604,-51.2157942,-30.0469069);

But returned a geometry .. I need the lat / long

010500000016000000010200000002000000A8C64B37899949C00257C38F7B0C3EC0007A75E9BA9949C02EA7A90AB20C3EC0010200000002000000BCD86AC5ED9949C0735F73B3E40C3EC0D0F7AE9C189A49C0146FAEAB130D3EC001020000000300000038C2FDDBC09A49C0F0B1AA14F10C3EC018192EBCDC9A49C09714692CAB0C3EC0F2E8EB9EE19A49C028994121A70C3EC0010200000002000000007A75E9BA9949C02EA7A90AB20C3EC0BCD86AC5ED9949C0735F73B3E40C3EC001020000000....
5

I think moving the St_AsText() call to the outermost part of your query accomplish what you want

SELECT ST_AsText(ST_Union(geom)) FROM pgr_fromAtoB('ways',-51.1995,-30.0487604,-51.2157942,-30.0469069);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.