15 |
import binascii |
import binascii |
16 |
import unittest |
import unittest |
17 |
|
|
18 |
|
from mockgeo import SimpleShapeStore |
19 |
import support |
import support |
20 |
support.initthuban() |
support.initthuban() |
21 |
|
|
25 |
from Thuban.Model.layer import Layer, RasterLayer |
from Thuban.Model.layer import Layer, RasterLayer |
26 |
from Thuban.Model.table import MemoryTable, \ |
from Thuban.Model.table import MemoryTable, \ |
27 |
FIELDTYPE_DOUBLE, FIELDTYPE_INT, FIELDTYPE_STRING |
FIELDTYPE_DOUBLE, FIELDTYPE_INT, FIELDTYPE_STRING |
28 |
|
from Thuban.Model.classification import ClassGroupSingleton |
29 |
import Thuban.Model.resource |
import Thuban.Model.resource |
30 |
|
|
31 |
|
|
32 |
from Thuban.UI.baserenderer import BaseRenderer |
from Thuban.UI.baserenderer import BaseRenderer |
33 |
|
|
34 |
|
|
92 |
self.raster_data = data |
self.raster_data = data |
93 |
|
|
94 |
|
|
|
class SimpleShape: |
|
|
|
|
|
def __init__(self, points): |
|
|
self.points = points |
|
|
|
|
|
def Points(self): |
|
|
return self.points |
|
|
|
|
|
class SimpleShapeStore: |
|
|
|
|
|
def __init__(self, shapetype, shapes, table): |
|
|
self.shapetype = shapetype |
|
|
self.shapes = shapes |
|
|
self.table = table |
|
|
assert table.NumRows() == len(shapes) |
|
|
|
|
|
def ShapeType(self): |
|
|
return self.shapetype |
|
|
|
|
|
def Table(self): |
|
|
return self.table |
|
|
|
|
|
def NumShapes(self): |
|
|
return len(self.shapes) |
|
|
|
|
|
def Shape(self, index): |
|
|
return SimpleShape(self.shapes[index]) |
|
|
|
|
|
|
|
95 |
class MockProjection: |
class MockProjection: |
96 |
|
|
97 |
"""Objects that look like projections but simply apply non-uniform scalings |
"""Objects that look like projections but simply apply non-uniform scalings |