Permalink
Browse files

ignoring polygons with less than 3 points

  • Loading branch information...
1 parent 0fce1e0 commit 8225f6d85bfd4b8ef859c7a3fcc2e8e22e329ab9 @gka gka committed May 15, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 kartograph/geometry/feature/MultiPolygonFeature.py
@@ -149,10 +149,13 @@ def restore_geometry(self, lines):
print len(ext),
holes = []
while num_hole > 0:
- holes.append(ring_iter.next())
+ hole = ring_iter.next()
+ if len(hole) > 3:
+ holes.append(hole)
holes_total += 1
num_hole -= 1
- polygons.append(Polygon(ext, holes))
+ if len(ext) > 3:
+ polygons.append(Polygon(ext, holes))
print '\t %d polygons \t %d rings \t %d holes' % (len(polygons), len(rings), holes_total)
self.geometry = MultiPolygon(polygons)

0 comments on commit 8225f6d

Please sign in to comment.