Exemplo n.º 1
0
    def test_equivalent_site(self):
        self.build_more_features_in_subsites()
        cleaner = recursively_merge_all_subsites(self.mainsite)
        equiv = cleaner.equivalent_site

        self.assertCountEqual(equiv.subsites, [])
        self.assertNotIn("{Out of subsite area}", equiv.features_by_id)
        self.assertIn("{Subsub level curve}", equiv.features_by_id)
Exemplo n.º 2
0
    def test_split_level_curve(self):
        self.build_more_features_in_subsites()
        cleaner = recursively_merge_all_subsites(self.mainsite)

        self.assertIn("{Cut level curve}", cleaner.geom)
        geom, info = cleaner["{Cut level curve}"]
        expected_shape = geometry.MultiLineString([[(6.5, 5.5), (6.5, 6.5)],
                                                   [(6.5, 7.5), (6.5, 8)]])
        self.assertTrue(expected_shape.equals(geom))
Exemplo n.º 3
0
    def test_recursive_merge(self):
        self.build_more_features_in_subsites()
        cleaner = recursively_merge_all_subsites(self.mainsite)

        self.assertIn("{Subsub level curve}", cleaner.geom)
        geom, info = cleaner["{Subsub level curve}"]
        expected_shape = geometry.LineString([(6, 6.5), (7, 7.5)])
        self.assertTrue(expected_shape.equals(geom))
        self.assertEqual(info['site'], self.subsubsite.id)
Exemplo n.º 4
0
 def test_plot_equivalent_site(self):
     self.build_more_features_in_subsites()
     cleaner = recursively_merge_all_subsites(self.mainsite)
     cleaner.equivalent_site.plot(self.ax, alt_geom_map=cleaner.geom)
Exemplo n.º 5
0
 def test_plot_recursive_merge(self):
     self.build_more_features_in_subsites()
     cleaner = recursively_merge_all_subsites(self.mainsite)
     self.mainsite.plot(self.ax, recursive=True, alt_geom_map=cleaner.geom)
Exemplo n.º 6
0
 def test_recursive_merge_outside_not_allowed(self):
     with self.assertRaises(RuntimeError) as cm:
         recursively_merge_all_subsites(self.mainsite, allow_outside=False)
     self.assertIn("{Level curve A}", str(cm.exception))