0

I'm a biginner of spatialite-gui.

I have 300,000 lines and one polygon, this polygon contains some of the lines.

So, I tried to use function (ST_contains) to add a flag (999) to the target lines and update them. But I can't do it well. I would be happy to get some advice.


update table set flug = 999 from lines as l polygon as p where ST_contains(l.geom, p.geom)=1;

Yas
  • 1
  • 1
  • Spatialie (SQLite) doesn't support "UPDATE ... FROM" (alas). You have to do something like (I didn't tested it): update lines set flug = 999 where fid in (select l.fid from lines as l, polygon as p where ST_Contains(p.geom, l.geom)); where "fid" is the primary key or a unique field of lines. Also, ST_Contains has the other sense: ST_Contains(container, contained). Search "sqlite update from another table" or "sqlite update with join" for a better explanation – Giovanni Zezza Jul 09 '20 at 18:47
  • Thank you. I've never heard of it before. I'll give it a try. – Yas Jul 13 '20 at 00:44

0 Answers0