46 |
LoadCancelled |
LoadCancelled |
47 |
from Thuban.Model.color import Transparent |
from Thuban.Model.color import Transparent |
48 |
from Thuban.Model.classification import ClassGroupProperties, ClassGroupRange,\ |
from Thuban.Model.classification import ClassGroupProperties, ClassGroupRange,\ |
49 |
ClassGroupSingleton, ClassGroupDefault |
ClassGroupSingleton, ClassGroupPattern, ClassGroupDefault |
50 |
from Thuban.Model.postgisdb import ConnectionError |
from Thuban.Model.postgisdb import ConnectionError |
51 |
from Thuban.Model.table import DBFTable, MemoryTable, \ |
from Thuban.Model.table import DBFTable, MemoryTable, \ |
52 |
FIELDTYPE_DOUBLE, FIELDTYPE_INT, FIELDTYPE_STRING, \ |
FIELDTYPE_DOUBLE, FIELDTYPE_INT, FIELDTYPE_STRING, \ |
175 |
elif data[CLASSES][i][GROUP_TYPE] == "single": |
elif data[CLASSES][i][GROUP_TYPE] == "single": |
176 |
g = ClassGroupSingleton(data[CLASSES][i][GROUP_DATA], |
g = ClassGroupSingleton(data[CLASSES][i][GROUP_DATA], |
177 |
props, data[CLASSES][i][GROUP_LABEL]) |
props, data[CLASSES][i][GROUP_LABEL]) |
178 |
|
elif data[CLASSES][i][GROUP_TYPE] == "pattern": |
179 |
|
g = ClassGroupPattern(data[CLASSES][i][GROUP_DATA], |
180 |
|
props, data[CLASSES][i][GROUP_LABEL]) |
181 |
|
|
182 |
eq(group, g) |
eq(group, g) |
183 |
|
|
459 |
filename="../../Data/iceland/political.shp"/> |
filename="../../Data/iceland/political.shp"/> |
460 |
<fileshapesource filetype="shapefile" id="D138504492" |
<fileshapesource filetype="shapefile" id="D138504492" |
461 |
filename="../../Data/iceland/political.shp"/> |
filename="../../Data/iceland/political.shp"/> |
462 |
|
<fileshapesource filetype="shapefile" id="D123456789" |
463 |
|
filename="../../Data/iceland/cultural_landmark-point.shp"/> |
464 |
<map title="Test Map"> |
<map title="Test Map"> |
465 |
<projection name=""> |
<projection name=""> |
466 |
<parameter value="zone=26"/> |
<parameter value="zone=26"/> |
503 |
</clpoint> |
</clpoint> |
504 |
</classification> |
</classification> |
505 |
</layer> |
</layer> |
506 |
|
<layer shapestore="D123456789" visible="true" title="My Layer 3"> |
507 |
|
<classification field="CLPTLABEL" field_type="string"> |
508 |
|
<clnull label=""> |
509 |
|
<cldata stroke="#000000" size="5" stroke_width="2" fill="None"/> |
510 |
|
</clnull> |
511 |
|
<clpoint label="" value="FARM"> |
512 |
|
<cldata stroke="#111111" size="5" stroke_width="1" fill="None"/> |
513 |
|
</clpoint> |
514 |
|
<clpattern label="" pattern="BUI"> |
515 |
|
<cldata stroke="#000000" size="5" stroke_width="1" fill="None"/> |
516 |
|
</clpattern> |
517 |
|
</classification> |
518 |
|
</layer> |
519 |
</map> |
</map> |
520 |
</session> |
</session> |
521 |
''' |
''' |
547 |
("range", (-1, 0), "", |
("range", (-1, 0), "", |
548 |
("#000000", 1, "None")), |
("#000000", 1, "None")), |
549 |
("single", -.5, "", |
("single", -.5, "", |
550 |
("#000000", 1, "None"))])] |
("#000000", 1, "None"))]), |
551 |
|
("My Layer 3", 2, |
552 |
|
[("default", (), "", |
553 |
|
("#000000", 2, "None")), |
554 |
|
("single", "FARM", "", |
555 |
|
("#111111", 1, "None")), |
556 |
|
("pattern", "BUI", "", |
557 |
|
("#000000", 1, "None"))]), |
558 |
|
] |
559 |
|
|
560 |
self.TestLayers(map.Layers(), expected) |
self.TestLayers(map.Layers(), expected) |
561 |
|
|