Skip to main content
1 of 3
Pil Kwon
  • 1.1k
  • 2
  • 9
  • 23

st_difference (erase overlapped feature) is not working properly

I have two layers. One is MultiLineString and the other is MultiPolygon.

enter image description here

I am trying to erase lines that are on the polygon feature With QGIS difference tool, it worked just fine

This is my code and I do not understand what is wrong with my query. I do not see anything wrong.

select a.objectid, st_difference(a.geom, b.geom) as shape
from line a, mesh b
limit 500

The results return line segments that are also in the mesh. enter image description here

Pil Kwon
  • 1.1k
  • 2
  • 9
  • 23