bdit_data-sources icon indicating copy to clipboard operation
bdit_data-sources copied to clipboard

text_to_centreline not returning anything

Open imadsyed333 opened this issue 1 year ago • 2 comments

text_to_centreline does not seem to be constructing certain geometries (whole_centreline and line_geom) depending on the distance from the intersection that is provided as an input. In turn, text_to_centreline does not return anything.

image

image

imadsyed333 avatar Nov 20 '23 18:11 imadsyed333

This where clause limits results to portions that are at least 10% of the centreline length: https://github.com/CityofToronto/bdit_data-sources/blob/7cf366cb3cfb1b0908b14e7b13d6f53bcafcc26f/gis/text_to_centreline/sql/function-centreline_case1.sql#L91C8-L95C61

9.8m works because that cl is 97.96m:

SELECT * FROM gis.text_to_centreline(0, 'Yonge St', 'Bloor St and a point 9.8 metres south', null)

@chmnata can you think of any undesirable affects from removing this constraint?

gabrielwol avatar Aug 06 '24 19:08 gabrielwol

I think its related to Step 4 of the below case. https://github.com/CityofToronto/bdit_data-sources/blob/7cf366cb3cfb1b0908b14e7b13d6f53bcafcc26f/gis/text_to_centreline/README.md#2c-special-case-1---an-intersection-and-an-offset

Where is it making sure at least 0.1 percent of the centreline is within the buffer (3 * (length between point A and translated point A) [which would be e.g. 3 * 9.8m ], which could also use some improvements, cause for example if the distance btwn the translated point and the point is 100m then the buffer would be 300m, which is way too big.

I think the ratio is in there to make sure the centreline matched is not incorrectly matched if the buffer is too large (which I think changing the buffer would work as well)

Maybe we could change the buffer to 10m + (distance btwn point A and translated point), and the ratio could change to like 1 metre or 3 metre for now ? I don't think a lot of cases would have a small translate.

chmnata avatar Aug 06 '24 21:08 chmnata