Пример #1
0
def test_RasterTemplate_from_raster():
    _raster = resource_filename('propagator.testing._Template', 'dem.tif')
    raster = utils.load_data(_raster, 'raster')
    template = utils.RasterTemplate.from_raster(raster)
    nt.assert_equal(template.meanCellWidth, raster.meanCellWidth)
    nt.assert_equal(template.meanCellHeight, raster.meanCellHeight)
    nt.assert_equal(template.extent.lowerLeft.X, raster.extent.lowerLeft.X)
    nt.assert_equal(template.extent.lowerLeft.Y, raster.extent.lowerLeft.Y)
Пример #2
0
 def test_already_a_raster(self):
     raster = arcpy.Raster(self.rasterpath)
     x = utils.load_data(raster, 'raster')
     nt.assert_true(isinstance(x, arcpy.Raster))
Пример #3
0
 def test_already_a_layer(self):
     lyr = arcpy.mapping.Layer(self.vectorpath)
     x = utils.load_data(lyr, 'layer')
     nt.assert_equal(x, lyr)
Пример #4
0
 def test_vector_as_layer_with_caps(self):
     x = utils.load_data(self.vectorpath, 'LAyeR')
     nt.assert_true(isinstance(x, arcpy.mapping.Layer))
Пример #5
0
 def test_raster_as_layer_greedy(self):
     x = utils.load_data(self.rasterpath, 'layer')
     nt.assert_true(isinstance(x, arcpy.Raster))
Пример #6
0
 def test_vector_as_shape(self):
     x = utils.load_data(self.vectorpath, 'shape')
     nt.assert_true(isinstance(x, arcpy.mapping.Layer))
Пример #7
0
 def test_raster_as_grid_with_caps(self):
     x = utils.load_data(self.rasterpath, 'gRId')
     nt.assert_true(isinstance(x, arcpy.Raster))
Пример #8
0
 def test_raster_as_layer_not_greedy(self):
     x = utils.load_data(self.rasterpath, 'layer', greedyRasters=False)
     nt.assert_true(isinstance(x, arcpy.mapping.Layer))
Пример #9
0
 def test_vector_as_raster_should_fail(self):
     x = utils.load_data(self.vectorpath, 'raster')
Пример #10
0
 def test_vector_as_grid_should_fail(self):
     x = utils.load_data(self.vectorpath, 'grid')
Пример #11
0
 def test_datapath_bad_value(self):
     utils.load_data(12345, 'grid')
Пример #12
0
 def test_datapath_doesnt_exist(self):
     utils.load_data('junk.shp', 'grid')
Пример #13
0
 def test_bad_datatype(self):
     utils.load_data(self.rasterpath, 'JUNK')