コード例 #1
0
    def test_write_prj_wrong(self, example_shp, tmpdir, shp_paths,
                             warn_wrong_prj):
        x, y, _ = spatial_efd.ProcessGeometry(example_shp[1])
        coeffs = spatial_efd.CalculateEFD(x, y, 10)

        with warnings.catch_warnings(record=True) as w:
            spatial_efd.generateShapefile(tmpdir.strpath, prj=shp_paths[0])

            assert os.path.isfile('{0}.shp'.format(tmpdir))
            assert not os.path.isfile('{0}.prj'.format(tmpdir))
            assert len(w) == 1
            assert issubclass(w[0].category, UserWarning)
            assert clean_warning(w[0].message) == warn_wrong_prj
コード例 #2
0
 def test_save_shapefile(self, example_shp, tmpdir):
     x, y, _ = spatial_efd.ProcessGeometry(example_shp[1])
     coeffs = spatial_efd.CalculateEFD(x, y, 10)
     shape = spatial_efd.generateShapefile()
     shape = spatial_efd.writeGeometry(coeffs, x, y, 4, shape, 1)
     spatial_efd.saveShapefile(tmpdir.strpath, shape, prj=None)
     assert os.path.isfile('{}.shp'.format(tmpdir))
コード例 #3
0
 def test_write_geometry_prj(self, example_shp, tmpdir, shp_paths):
     x, y, _ = spatial_efd.ProcessGeometry(example_shp[1])
     coeffs = spatial_efd.CalculateEFD(x, y, 10)
     shape = spatial_efd.generateShapefile(tmpdir.strpath, prj=shp_paths[1])
     shape = spatial_efd.writeGeometry(coeffs, x, y, 4, shape, 1)
     assert os.path.isfile('{}.shp'.format(tmpdir))
     assert os.path.isfile('{}.prj'.format(tmpdir))
コード例 #4
0
 def test_generate_shapefile(self):
     shape = spatial_efd.generateShapefile()
     assert isinstance(shape, shp.Writer)
コード例 #5
0
 def test_write_geometry(self, example_shp):
     x, y, _ = spatial_efd.ProcessGeometry(example_shp[1])
     coeffs = spatial_efd.CalculateEFD(x, y, 10)
     shape = spatial_efd.generateShapefile()
     shape = spatial_efd.writeGeometry(coeffs, x, y, 4, shape, 1)
     assert isinstance(shape, shp.Writer)
コード例 #6
0
 def test_generate_shapefile(self, tmpdir):
     shape = spatial_efd.generateShapefile(tmpdir.strpath)
     assert isinstance(shape, shp.Writer)