Esempio n. 1
0
 def testLoadStaticRaster(self):
     aRaster = StaticRaster()
     loader = GeneralState.rasterLoader()
     loader.fillGDALRaster(aRaster, '../../resources/test.tiff')
     self.assertEqual(120, aRaster.getSize()._width)
     self.assertEqual(120, aRaster.getSize()._height)
     self.assertEqual(139, aRaster.getValue(Point2DInt(39, 39)))
Esempio n. 2
0
 def testLoadStaticRaster(self):
     aRaster = StaticRaster()
     loader = GeneralState.rasterLoader()
     loader.fillGDALRaster(aRaster, '../../resources/test.tiff')
     self.assertEqual(120, aRaster.getSize()._width)
     self.assertEqual(120, aRaster.getSize()._height)
     self.assertEqual(139, aRaster.getValue(Point2DInt(39,39)))
Esempio n. 3
0
#!/usr/bin/env python

import os, sys

pandoraPath = os.getenv('PANDORAPATH', '/usr/local/pandora')
sys.path.append(pandoraPath + '/bin')
sys.path.append(pandoraPath + '/lib')

from pyPandora import Point2DInt, StaticRaster, DynamicRaster, SizeInt

testStaticRaster = StaticRaster()
print('Static Raster - size: ', testStaticRaster.getSize())
size = SizeInt(5, 5)
testStaticRaster.resize(size)
print('Static Raster - size changed: ', testStaticRaster.getSize())

testDynamicRaster = DynamicRaster()
testDynamicRaster.resize(size)
testDynamicRaster.setInitValues(0, 1000, 0)

print('Dynamic Raster - size: ', testDynamicRaster.getSize())
for i in range(0, size._width):
    for j in range(0, size._height):
        index = Point2DInt(i, j)
        testDynamicRaster.setValue(index, i * size._width + j)

for i in range(0, size._width):
    line = ''
    for j in range(0, size._height):
        index = Point2DInt(i, j)
        line = line + '[' + str(i) + '][' + str(j) + ']=' + str(
Esempio n. 4
0
#!/usr/bin/env python3

import os, sys

pandoraPath = os.getenv("PANDORAPATH", "/usr/local/pandora")
sys.path.append(pandoraPath + "/bin")
sys.path.append(pandoraPath + "/lib")

from pyPandora import Point2DInt, StaticRaster, DynamicRaster, SizeInt

testStaticRaster = StaticRaster()
print("Static Raster - size: ", testStaticRaster.getSize())
size = SizeInt(5, 5)
testStaticRaster.resize(size)
print("Static Raster - size changed: ", testStaticRaster.getSize())

testDynamicRaster = DynamicRaster()
testDynamicRaster.resize(size)
testDynamicRaster.setInitValues(0, 1000, 0)

print("Dynamic Raster - size: ", testDynamicRaster.getSize())
for i in range(0, size._width):
    for j in range(0, size._height):
        index = Point2DInt(i, j)
        testDynamicRaster.setValue(index, i * size._width + j)

for i in range(0, size._width):
    line = ""
    for j in range(0, size._height):
        index = Point2DInt(i, j)
        line = line + "[" + str(i) + "][" + str(j) + "]=" + str(testDynamicRaster.getValue(index)) + " "
Esempio n. 5
0
#!/usr/bin/python3

import sys
sys.path.append('../')
sys.path.append('../../')
from pyPandora import Point2DInt, StaticRaster, Raster, SizeInt

testStaticRaster = StaticRaster()
print('Static Raster - size: ',testStaticRaster.getSize())
size = SizeInt(5,5)
testStaticRaster.resize(size)
print('Static Raster - size changed: ',testStaticRaster.getSize())

testRaster = Raster()
testRaster.resize(size)
testRaster.setInitValues(0, 1000, 0)

for i in range(0,size._width):
	for j in range(0,size._height):
		index = Point2DInt(i,j)
		testRaster.setValue(index, i*size._width+j)

for i in range(0,size._width):
	line = ''
	for j in range(0,size._height):
		index = Point2DInt(i,j)
		line = line + '[' + str(i) + '][' + str(j) + ']=' + str(testRaster.getValue(index)) + ' '
	print(line)

Esempio n. 6
0
#!/usr/bin/python

import sys
sys.path.append('../')
sys.path.append('../../')
from pyPandora import Point2DInt, StaticRaster, Raster

testStaticRaster = StaticRaster()
print 'Static Raster - size: ' + str(testStaticRaster.getSize()._x) + ' - ' + str(testStaticRaster.getSize()._y)
size = Point2DInt(5,5)
testStaticRaster.resize(size)
print 'Static Raster - size changed: ' + str(testStaticRaster.getSize()._x) + ' - ' + str(testStaticRaster.getSize()._y)

testRaster = Raster()
testRaster.resize(size)
testRaster.setInitValues(0, 1000, 0)

for i in range(0,size._x):
	for j in range(0,size._y):
		index = Point2DInt(i,j)
		testRaster.setValue(index, i*size._x+j)

for i in range(0,size._x):
	line = ''
	for j in range(0,size._y):
		index = Point2DInt(i,j)
		line = line + '[' + str(i) + '][' + str(j) + ']=' + str(testRaster.getValue(index)) + ' '
	print line

Esempio n. 7
0
#!/usr/bin/python

import sys
sys.path.append('../')
sys.path.append('../../')
from pyPandora import Point2DInt, StaticRaster, Raster

testStaticRaster = StaticRaster()
print 'Static Raster - size: ' + str(
    testStaticRaster.getSize()._x) + ' - ' + str(testStaticRaster.getSize()._y)
size = Point2DInt(5, 5)
testStaticRaster.resize(size)
print 'Static Raster - size changed: ' + str(
    testStaticRaster.getSize()._x) + ' - ' + str(testStaticRaster.getSize()._y)

testRaster = Raster()
testRaster.resize(size)
testRaster.setInitValues(0, 1000, 0)

for i in range(0, size._x):
    for j in range(0, size._y):
        index = Point2DInt(i, j)
        testRaster.setValue(index, i * size._x + j)

for i in range(0, size._x):
    line = ''
    for j in range(0, size._y):
        index = Point2DInt(i, j)
        line = line + '[' + str(i) + '][' + str(j) + ']=' + str(
            testRaster.getValue(index)) + ' '
    print line