Background: Sometimes in modelling hydrology (e.g. in SWMM) we have runon from one subcatchment area to another. These subcatchments are records in a shapefile. I want to show this situation as a line from the centroid of one polygon to another (the "outlet"). This is what I tried (which obviously doesn't work):
select make_line(st_centroid(Subcatchments.geometry),st_centroid(Subcatchments.geometry))
from Subcatchments
where Subcatchments.OUTLET = Subcatchments.Name
Can anybody assist me in how to do this correctly?