Пример #1
0
    def test_multiple_indexes(self):
        ix1 = GeoIndex('./test_indices', 'test_multiple_indexes', int, int)
        ix2 = GeoIndex('./test_indices', 'test_multiple_indexes', int, int)

        ix1.insert(1L, poly1)
        ix2.insert(2L, poly2)
        ix1.insert(3L, poly3)

        x = ix1.intersects(cover)
        x = list(x)
        y = ix2.intersects(cover)
        y = list(y)

        self.assertEqual(len(x), 3, "Didn't pull back all ids with first index")
        self.assertEqual(sorted(x), [1,2,3], "Didn't pull back all ids with first index")
        self.assertEqual(len(y), 3, "didn't pull back all ids with second index")
        self.assertEqual(sorted(y), [1,2,3], "Didn't pull back all ids with second index")

        ix1.drop()
        ix2.drop()