Skip to content

Commit

Permalink
ignoring polygons with less than 3 points
Browse files Browse the repository at this point in the history
  • Loading branch information
gka committed May 15, 2012
1 parent 0fce1e0 commit 8225f6d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kartograph/geometry/feature/MultiPolygonFeature.py
Expand Up @@ -149,10 +149,13 @@ def restore_geometry(self, lines):
print len(ext), print len(ext),
holes = [] holes = []
while num_hole > 0: while num_hole > 0:
holes.append(ring_iter.next()) hole = ring_iter.next()
if len(hole) > 3:
holes.append(hole)
holes_total += 1 holes_total += 1
num_hole -= 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) print '\t %d polygons \t %d rings \t %d holes' % (len(polygons), len(rings), holes_total)
self.geometry = MultiPolygon(polygons) self.geometry = MultiPolygon(polygons)


Expand Down

0 comments on commit 8225f6d

Please sign in to comment.