Exemplo n.º 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)
Exemplo n.º 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))
Exemplo n.º 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)
Exemplo n.º 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))
Exemplo n.º 5
0
 def test_raster_as_layer_greedy(self):
     x = utils.load_data(self.rasterpath, 'layer')
     nt.assert_true(isinstance(x, arcpy.Raster))
Exemplo n.º 6
0
 def test_vector_as_shape(self):
     x = utils.load_data(self.vectorpath, 'shape')
     nt.assert_true(isinstance(x, arcpy.mapping.Layer))
Exemplo n.º 7
0
 def test_raster_as_grid_with_caps(self):
     x = utils.load_data(self.rasterpath, 'gRId')
     nt.assert_true(isinstance(x, arcpy.Raster))
Exemplo n.º 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))
Exemplo n.º 9
0
 def test_vector_as_raster_should_fail(self):
     x = utils.load_data(self.vectorpath, 'raster')
Exemplo n.º 10
0
 def test_vector_as_grid_should_fail(self):
     x = utils.load_data(self.vectorpath, 'grid')
Exemplo n.º 11
0
 def test_datapath_bad_value(self):
     utils.load_data(12345, 'grid')
Exemplo n.º 12
0
 def test_datapath_doesnt_exist(self):
     utils.load_data('junk.shp', 'grid')
Exemplo n.º 13
0
 def test_bad_datatype(self):
     utils.load_data(self.rasterpath, 'JUNK')