19 |
support.initthuban() |
support.initthuban() |
20 |
|
|
21 |
from Thuban.Model.color import Transparent, Color |
from Thuban.Model.color import Transparent, Color |
22 |
from Thuban.Model.data import Shape, SHAPETYPE_ARC, SHAPETYPE_POLYGON, \ |
from Thuban.Model.data import SHAPETYPE_ARC, SHAPETYPE_POLYGON, SHAPETYPE_POINT |
|
SHAPETYPE_POINT |
|
23 |
from Thuban.Model.map import Map |
from Thuban.Model.map import Map |
24 |
from Thuban.Model.layer import Layer, RasterLayer |
from Thuban.Model.layer import Layer, RasterLayer |
25 |
from Thuban.Model.table import MemoryTable, \ |
from Thuban.Model.table import MemoryTable, \ |
26 |
FIELDTYPE_DOUBLE, FIELDTYPE_INT, FIELDTYPE_STRING |
FIELDTYPE_DOUBLE, FIELDTYPE_INT, FIELDTYPE_STRING |
27 |
|
import Thuban.Model.resource |
28 |
|
|
29 |
from Thuban.UI.baserenderer import BaseRenderer |
from Thuban.UI.baserenderer import BaseRenderer |
30 |
|
|
88 |
def draw_raster_data(self, data): |
def draw_raster_data(self, data): |
89 |
self.raster_data = data |
self.raster_data = data |
90 |
|
|
91 |
|
|
92 |
|
class SimpleShape: |
93 |
|
|
94 |
|
def __init__(self, points): |
95 |
|
self.points = points |
96 |
|
|
97 |
|
def Points(self): |
98 |
|
return self.points |
99 |
|
|
100 |
class SimpleShapeStore: |
class SimpleShapeStore: |
101 |
|
|
102 |
def __init__(self, shapetype, shapes, table): |
def __init__(self, shapetype, shapes, table): |
115 |
return len(self.shapes) |
return len(self.shapes) |
116 |
|
|
117 |
def Shape(self, index): |
def Shape(self, index): |
118 |
return Shape(self.shapes[index]) |
return SimpleShape(self.shapes[index]) |
119 |
|
|
120 |
|
|
121 |
class MockProjection: |
class MockProjection: |
293 |
to round-off errors. It simply compares the complete BMP file |
to round-off errors. It simply compares the complete BMP file |
294 |
returned by gdalwarp.ProjectRasterFile to a BMP file data. |
returned by gdalwarp.ProjectRasterFile to a BMP file data. |
295 |
""" |
""" |
296 |
|
if not Thuban.Model.resource.has_gdal_support(): |
297 |
|
raise support.SkipTest("No gdal support") |
298 |
|
|
299 |
map = Map("TestBaseRenderer") |
map = Map("TestBaseRenderer") |
300 |
|
|
301 |
layer = RasterLayer("raster layer", |
layer = RasterLayer("raster layer", |