Beispiel #1
0
    def test_calculation_of_tie_point_grid(self):
        # get instance of COREG_LOCAL object
        CRL = COREG_LOCAL(self.ref_path, self.tgt_path, **self.coreg_kwargs)

        # calculate tie point grid
        CRL.calculate_spatial_shifts()

        # test tie point grid visualization
        with warnings.catch_warnings():
            warnings.filterwarnings(
                'ignore',
                category=UserWarning,
                message='Matplotlib is currently using agg, '
                'which is a non-GUI backend, so cannot show the figure.')
            CRL.view_CoRegPoints(hide_filtered=True)
            CRL.view_CoRegPoints(hide_filtered=False)
            CRL.view_CoRegPoints(shapes2plot='vectors')
            CRL.view_CoRegPoints_folium()

        # test shift correction and output writer
        CRL.correct_shifts()

        self.assertTrue(
            os.path.exists(self.coreg_kwargs['path_out']),
            'Output of local co-registration has not been written.')
Beispiel #2
0
    def test_calculation_of_tie_point_grid(self):
        # get instance of COREG_LOCAL object
        CRL = COREG_LOCAL(self.ref_path, self.tgt_path, **self.coreg_kwargs)

        # use the getter of the CoRegPoints_table to calculate tie point grid
        # noinspection PyStatementEffect
        CRL.CoRegPoints_table

        # test tie point grid visualization
        if find_loader(
                'mpl_toolkits.basemap'):  # only works if basemap is installed
            CRL.view_CoRegPoints(hide_filtered=True)
            CRL.view_CoRegPoints(hide_filtered=False)
            CRL.view_CoRegPoints(shapes2plot='vectors')

        if find_loader('folium') and find_loader('geojson'):
            CRL.view_CoRegPoints_folium()

        # test shift correction and output writer
        CRL.correct_shifts()

        self.assertTrue(
            os.path.exists(self.coreg_kwargs['path_out']),
            'Output of local co-registration has not been written.')