'Testing MultiPolygon objects.'

def test05b_multipolygons(self):

    print '\nBEGIN    -    expecting    GEOS_NOTICE;    safe    to    ignore.\n'
    prev = fromstr('POINT    (0    0)')
    for mp in self.geometries.multipolygons:
        mpoly = fromstr(mp.wkt)
        self.assertEqual(mpoly.geom_type, 'MultiPolygon')
        self.assertEqual(mpoly.geom_typeid, 6)
        self.assertEqual(mp.valid, mpoly.valid)
        if mp.valid:
            self.assertEqual(mp.num_geom, mpoly.num_geom)
            self.assertEqual(mp.n_p, mpoly.num_coords)
            self.assertEqual(mp.num_geom, len(mpoly))
            self.assertRaises(GEOSIndexError, mpoly.__getitem__, len(mpoly))
            for p in mpoly:
                self.assertEqual(p.geom_type, 'Polygon')
                self.assertEqual(p.geom_typeid, 3)
                self.assertEqual(p.valid, True)
            self.assertEqual(mpoly.wkt, MultiPolygon(*tuple((poly.clone() for poly in mpoly))).wkt)
    print '\nEND    -    expecting    GEOS_NOTICE;    safe    to    ignore.\n'
