pombreda / pysal

Automatically exported from code.google.com/p/pysal
Other
0 stars 0 forks source link

Implement __nonzero__ for all shapes #145

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It may come up that you need to evaluate if a shape is or isn't.

For example,

shpfile = pysal.open('some.shp')
if shpfile.bounding_box:
  do something

In this case the shape is a Rectangle.  I added __nonzero__ to Rectangle that 
will return False if the Rectangle has zero area.  See r832

Original issue reported on code.google.com by schmi...@gmail.com on 11 Feb 2011 at 9:47

GoogleCodeExporter commented 9 years ago
Implement __nonzero__ for all shapes.

False if Zero Area for 2d (polygons),
False if Zero Length for 1d (lines),
False if no coordinates are set. 

Original comment by schmi...@gmail.com on 13 Apr 2011 at 11:59

GoogleCodeExporter commented 9 years ago

Original comment by dfo...@gmail.com on 19 May 2011 at 6:46

GoogleCodeExporter commented 9 years ago

Original comment by sjsrey on 6 Aug 2011 at 12:16

GoogleCodeExporter commented 9 years ago

Original comment by sjsrey on 7 Oct 2011 at 7:35