This is a PostGIS query that I just tried on our data set so it may work for what you need, and I'm not much of a PostGIS expert yet so I'm 100% sure it could be done better but here goes anyway:
select DISTINCT ON (p."land_no") a."Road_asset_ID", p."land_no", p."SP_GEOMETRY"
from "roads_old_centre_lines" a
INNER JOIN "Property" p on st_intersects(st_buffer(a."SP_GEOMETRY",50), p."SP_GEOMETRY")
where a."Road_asset_ID" = 1500
OR a."Road_asset_ID" = 1502
It should create a buffer around the road and select the property geometry that intersects the buffer, the property land no, and the road id that was used for the buffer. It should also only select one property using DISTINCT ON (p."land_no")
even if the property touches two road buffers.
This query uses a buffer of 50m
but you will just need to adjust that so that cover the road reserve area.
This is what the result in QGIS looks like:
EDIT: This seems to do the count right, it's a bit slow due to having to do two runs but I'm sure someone might be able to optimize it.
SELECT road, Count(land_no) FROM
(select DISTINCT ON (p."land_no") a."Road_asset_ID" as road, p.land_no ,p."SP_GEOMETRY"
from "roads_old_centre_lines" a
INNER JOIN "Property" p on st_intersects(st_buffer(a."SP_GEOMETRY",50), p."SP_GEOMETRY")
where a."Road_asset_ID" = 1500 OR a."Road_asset_ID" = 1502) as Test
GROUP BY road
Best Answer
St_Intersection function will give you the a point/collection of points that are the intersection of two linestrings.
ST_Intersects
can be used to find linestrings that intersect.