i have a set of data that needs to be in linestring only before being converted to geojson, tried using st_dump to convert the st_makeline portion of the code which works fine but then i am having an issue converting it back to geojson, here is the code " limited to select only on this dataset"
select geo from (
SELECT
routeID , json_extract(st_asgeojson(st_makeline(array_agg(st_geogpoint(locs.lon,
locs.lat) order by locs.date))),'$.coordinates' )as geo,
FROM
howardcounty.routebatches
cross join UNNEST(locations) as locs
where locs.date between {{start_date}} and {{end_date}}
group by routeID
order by routeID
limit 100
)where length(geo) -length(replace(geo,"[","")) > 1+2
this is the error when inserting st_dump
json_extract(st_asgeojson(st_dump(st_makeline(array_agg(st_geogpoint(locs.lon, locs.lat) order by locs.date)))),'$.coordinates' )as geo,