'Testing PreparedGeometry support.'

@unittest.skipUnless(GEOS_PREPARE, u'geos    >=    3.1.0    is    required')
def test_prepared(self):

    mpoly = GEOSGeometry(u'MULTIPOLYGON(((0    0,0    5,5    5,5    0,0    0)),((5    5,5    10,10    10,10    5,5    5)))')
    prep = mpoly.prepared
    pnts = [Point(5, 5), Point(7.5, 7.5), Point(2.5, 7.5)]
    covers = [True, True, False]
    for (pnt, c) in zip(pnts, covers):
        self.assertEqual(mpoly.contains(pnt), prep.contains(pnt))
        self.assertEqual(mpoly.intersects(pnt), prep.intersects(pnt))
        self.assertEqual(c, prep.covers(pnt))
