I am working with MariaDB and trying to get data based on the condition of linestrings that are within another linestring. To allow linestrings not having to be exactly within (due to GPX variability in coordinates, see note), I want to include a buffer.
SELECT * FROM tableX WHERE ST_WITHIN(ST_BUFFER(linestring,r), (SELECT linestring FROM tableY WHERE id=@id) )
I expect to retrieve at least one row, since this row is also retrieved with the same query without the buffer (so, I would expect this is equal to r=0). However, no matter how small or big r is, I get an empty table.
In the documentation it says that ST_BUFFER applies to all geometry objects, but I have only seen examples with points in either linestrings / polygons. It made me wonder if it is even possible to apply this function to linestrings within a linestring?
Hence, the buffer function would be very useful here.