Permalink
Browse files

Block water loading improvements

  • Loading branch information...
1 parent 4784205 commit 709f606bfd48319268f78fac46f5c0e4dd4f06ea @zain committed Mar 8, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 maps/blocks/load.py
View
@@ -22,5 +22,11 @@ def water():
def clean():
- for w in Water.objects.all():
- Block.objects.filter(poly__intersects=w.poly).delete()
+ ct = 1
+
+ for b in Block.objects.all():
+ if Water.objects.filter(poly__intersects=b.poly).count():
+ b.delete()
+
+ if ct % 1000 == 0: print ct
+ ct += 1

0 comments on commit 709f606

Please sign in to comment.