I have got area with line strings that are not quite similar to each other means that at some places they are not exactly at same position. This can be seen in the picture. I am making a buffer on linestring Area1 and then comparing it with the other linestring Area2. I am using ST_Intersection to get the intersection of buffer and linestring. As both areas are not located on each other so I have to increase the size of the buffer. There are also some extra linestrings in Area2 which I dont want. I only want the geometry of Area2 not Area1. My problem is that once I increase the size of buffer to get the intersection of both areas the extra lines in Area2 also comes in the geometry. I either want to remove these extra linestring from geometry or they should be compared in such a way that extra lines do not come from area2.
The first picture shows how area2 and area1 differs.
The query I am using is this in which I am getting the extra parts from AREA2 which I dont want.
Create Table Mytable As select ST_MULTI(ST_Intersection(Area2,ST_Buffer(SetSrid(Area1.geometry,3857),8))) AS Geometry from Area2 ,Area1 where ST_Intersects(Area2.geometry,ST_Buffer(SetSrid(Area1.geometry,3857),6))
I have tried everything but could not find the way.
Can Someone tell its not working? I have already tried ST_SNAP and ST_SNAPTOGRID but it is not working