I am trying to find the adress points (red dots) located in front of an obstacle (red polygon). The street is green and the pink line represents the street face (Si).
This is what I have so far, but another method would be acceptable as well.
Therefore I want to extend the blue line (which is the line from the adress point to the street face). And then check if the extension intersects with the polygon.
I am using the virtual layer function of QGIS but I can also simply do this with postgis. I tried to use this to write my query but I get mistakes (st_translate):
SELECT
adpt.id
,ST_TRANSLATE
(adpt.id,
sin(
ST_AZIMUTH
(ST_ClosestPoint(si.geometry, adpt.geometry), adpt.geometry)
)
* (
ST_Distance(
ST_ClosestPoint(si.geometry, adpt.geometry)
)
* 10
)
,
cos(
ST_AZIMUTH
(ST_ClosestPoint(si.geometry, adpt.geometry), adpt.geometry)
)
* (
ST_Distance(
ST_ClosestPoint(si.geometry, adpt.geometry)
)
* 10
)
)
FROM
xl_adpt_ss_si ADPT
JOIN xl_streetside si
ON adpt.SI_ID = si.id
where
ADPT.id='1136345'
;
Once I have my additional point, I want to use ST_MakeLine to draw the new line before computing the intersections.