Thursday, 14 May 2015

Remove duplicates from Spatialite


I have a Spatialite database with points. From time to time now points are added. What would be the easiest way to remove duplicates based on the coordinates?



Answer



Auto-joining the table would allow you to find duplicates rows. Something like that should work :


DELETE t1
FROM mytable t1, mytable t2
WHERE t1.the_geom = t2.the_geom

if points :


DELETE t1

FROM mytable t1, mytable t2
WHERE t1.x = t2.x
AND t1.y > t2.y

(not tested .....)


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...