remove area as it is unused (not needed by anything yet) - closes #846

This commit is contained in:
Dane Springmeyer 2011-10-21 15:55:58 -07:00
parent b34eb0664a
commit e0e47f50dd
3 changed files with 1 additions and 26 deletions

View file

@ -78,7 +78,6 @@ void export_geometry()
.def("envelope",&geometry_type::envelope)
// .def("__str__",&geometry_type::to_string)
.def("type",&geometry_type::type)
.def("area",&geometry_type::area)
// TODO add other geometry_type methods
;

View file

@ -68,27 +68,7 @@ public:
{
return type_;
}
double area() const
{
double sum = 0.0;
double x(0);
double y(0);
rewind(0);
double xs = x;
double ys = y;
for (unsigned i=0;i<num_points();++i)
{
double x0(0);
double y0(0);
vertex(&x0,&y0);
sum += x * y0 - y * x0;
x = x0;
y = y0;
}
return (sum + x * ys - y * xs) * 0.5;
}
box2d<double> envelope() const
{
box2d<double> result;

View file

@ -18,10 +18,6 @@ class FeatureTest(unittest.TestCase):
f = self.makeOne(1, 'POLYGON ((35 10, 10 20, 15 40, 45 45, 35 10),(20 30, 35 35, 30 20, 20 30))', foo="bar")
self.failUnlessEqual(f['foo'], 'bar')
self.failUnlessEqual(f.envelope(),Box2d(10.0,10.0,45.0,45.0))
area = 0.0
for g in f.geometries():
area += g.area()
self.failUnlessEqual(area,-450.0)
def test_set_get_properties(self):
f = self.makeOne(1)