Let us assume the following two lines
The two geometries are extracted by two different tables: table_1 and table_2 with respective column geometries geometry_1 and geometry_2. I want to check if the two lines are identical. Condition for this is if the max distance between the two lines is not longer than x meters. I am running the following:
create index geom_1_idx ON table1 USING GIST (geometry_1); select table1_id, table2_id from table1 t1, table2 t2 where (select st_DWithin(t1.geometry_2 , t2.geometry_2, units_of_srid) = true)
With spatial indexing, I understand that the comparison refers to the bounding boxes of the lines.
How correct is it?
Is a case like the one of the image covered?