34 |
from Thuban.Model.proj import Projection |
from Thuban.Model.proj import Projection |
35 |
from Thuban.Model.table import DBFTable |
from Thuban.Model.table import DBFTable |
36 |
from Thuban.Model.transientdb import TransientJoinedTable |
from Thuban.Model.transientdb import TransientJoinedTable |
37 |
from Thuban.Model.data import DerivedShapeStore |
from Thuban.Model.data import DerivedShapeStore, SHAPETYPE_ARC |
38 |
|
|
39 |
from Thuban.Model.classification import ClassGroupSingleton, ClassGroupRange, \ |
from Thuban.Model.classification import ClassGroupSingleton, ClassGroupRange, \ |
40 |
ClassGroupProperties |
ClassGroupPattern, ClassGroupProperties |
41 |
|
|
42 |
from Thuban.Model.range import Range |
from Thuban.Model.range import Range |
43 |
|
|
156 |
<parameter value="datum=WGS84"/> |
<parameter value="datum=WGS84"/> |
157 |
<parameter value="units=m"/> |
<parameter value="units=m"/> |
158 |
</projection> |
</projection> |
159 |
<layer title="My Layer" shapestore="D1" |
<layer title="My Layer" shapestore="D1" visible="%s"> |
160 |
fill="None" stroke="#000000" stroke_width="1" visible="%s"/> |
<classification> |
161 |
|
<clnull label=""> |
162 |
|
<cldata fill="None" stroke="#000000" |
163 |
|
stroke_width="1"/> |
164 |
|
</clnull> |
165 |
|
</classification> |
166 |
|
</layer> |
167 |
</map> |
</map> |
168 |
</session>''' |
</session>''' |
169 |
|
|
222 |
<parameter value="proj=utm"/> |
<parameter value="proj=utm"/> |
223 |
<parameter value="ellps=clrk66"/> |
<parameter value="ellps=clrk66"/> |
224 |
</projection> |
</projection> |
225 |
<layer title="My Layer" shapestore="D1" |
<layer title="My Layer" shapestore="D1" visible="true"> |
|
fill="None" stroke="#000000" stroke_width="1" visible="true"> |
|
226 |
<projection name="Layer Projection"> |
<projection name="Layer Projection"> |
227 |
<parameter value="proj=lcc"/> |
<parameter value="proj=lcc"/> |
228 |
<parameter value="ellps=clrk66"/> |
<parameter value="ellps=clrk66"/> |
229 |
<parameter value="lat_1=0"/> |
<parameter value="lat_1=0"/> |
230 |
<parameter value="lat_2=20"/> |
<parameter value="lat_2=20"/> |
231 |
</projection> |
</projection> |
232 |
|
<classification> |
233 |
|
<clnull label=""> |
234 |
|
<cldata fill="None" stroke="#000000" |
235 |
|
stroke_width="1"/> |
236 |
|
</clnull> |
237 |
|
</classification> |
238 |
</layer> |
</layer> |
239 |
</map> |
</map> |
240 |
</session>''' |
</session>''' |
342 |
ClassGroupProperties(), |
ClassGroupProperties(), |
343 |
internal_from_unicode(u'\xdcml\xe4uts'))) # Uemlaeuts |
internal_from_unicode(u'\xdcml\xe4uts'))) # Uemlaeuts |
344 |
|
|
345 |
|
# Pattern |
346 |
|
clazz.AppendGroup(ClassGroupPattern("BUI", ClassGroupProperties(), |
347 |
|
"pattern")) |
348 |
|
|
349 |
filename = self.temp_file_name("%s.thuban" % self.id()) |
filename = self.temp_file_name("%s.thuban" % self.id()) |
350 |
save_session(session, filename) |
save_session(session, filename) |
365 |
<parameter value="proj=utm"/> |
<parameter value="proj=utm"/> |
366 |
<parameter value="ellps=clrk66"/> |
<parameter value="ellps=clrk66"/> |
367 |
</projection> |
</projection> |
368 |
<layer title="My Layer" shapestore="D1" |
<layer title="My Layer" shapestore="D1" visible="true"> |
|
fill="None" stroke="#000000" stroke_width="1" visible="true"> |
|
369 |
<classification field="AREA" field_type="double"> |
<classification field="AREA" field_type="double"> |
370 |
<clnull label=""> |
<clnull label=""> |
371 |
<cldata fill="None" stroke="#000000" stroke_width="1"/> |
<cldata fill="None" stroke="#000000" stroke_width="1"/> |
384 |
</clrange> |
</clrange> |
385 |
</classification> |
</classification> |
386 |
</layer> |
</layer> |
387 |
<layer title="My Layer" shapestore="D1" |
<layer title="My Layer" shapestore="D1" visible="true"> |
|
fill="None" stroke="#000000" stroke_width="1" visible="true"> |
|
388 |
<classification field="POPYCOUN" field_type="string"> |
<classification field="POPYCOUN" field_type="string"> |
389 |
<clnull label=""> |
<clnull label=""> |
390 |
<cldata fill="None" stroke="#000000" stroke_width="1"/> |
<cldata fill="None" stroke="#000000" stroke_width="1"/> |
393 |
label="\xc3\x9cml\xc3\xa4uts"> |
label="\xc3\x9cml\xc3\xa4uts"> |
394 |
<cldata fill="None" stroke="#000000" stroke_width="1"/> |
<cldata fill="None" stroke="#000000" stroke_width="1"/> |
395 |
</clpoint> |
</clpoint> |
396 |
|
<clpattern pattern="BUI" label="pattern"> |
397 |
|
<cldata fill="None" stroke="#000000" stroke_width="1"/> |
398 |
|
</clpattern> |
399 |
</classification> |
</classification> |
400 |
</layer> |
</layer> |
401 |
</map> |
</map> |
501 |
shapesource="D142197204"/> |
shapesource="D142197204"/> |
502 |
<map title="Test Map"> |
<map title="Test Map"> |
503 |
<layer title="My Layer" |
<layer title="My Layer" |
504 |
shapestore="D141915644" visible="true" |
shapestore="D141915644" visible="true"> |
505 |
stroke="#000000" stroke_width="1" fill="None"/> |
<classification> |
506 |
|
<clnull label=""> |
507 |
|
<cldata fill="None" stroke="#000000" |
508 |
|
stroke_width="1"/> |
509 |
|
</clnull> |
510 |
|
</classification> |
511 |
|
</layer> |
512 |
</map> |
</map> |
513 |
</session>''' |
</session>''' |
514 |
|
|
532 |
def _fetch_table_information(self): |
def _fetch_table_information(self): |
533 |
# pretend that we've found a geometry column |
# pretend that we've found a geometry column |
534 |
self.geometry_column = "the_geom" |
self.geometry_column = "the_geom" |
535 |
|
# pretend this is a ARC shape type. |
536 |
|
self.shape_type = SHAPETYPE_ARC |
537 |
def IDColumn(self): |
def IDColumn(self): |
538 |
"""Return an object with a name attribute with value 'gid'""" |
"""Return an object with a name attribute with value 'gid'""" |
539 |
class dummycol: |
class dummycol: |
572 |
id_column="gid" geometry_column="the_geom"/> |
id_column="gid" geometry_column="the_geom"/> |
573 |
<map title="Test Map"> |
<map title="Test Map"> |
574 |
<layer title="Roads to Nowhere" |
<layer title="Roads to Nowhere" |
575 |
shapestore="roads" visible="true" |
shapestore="roads" visible="true"> |
576 |
stroke="#000000" stroke_width="1" fill="None"/> |
<classification> |
577 |
|
<clnull label=""> |
578 |
|
<cldata fill="None" stroke="#000000" |
579 |
|
stroke_width="1"/> |
580 |
|
</clnull> |
581 |
|
</classification> |
582 |
|
</layer> |
583 |
</map> |
</map> |
584 |
</session>''' |
</session>''' |
585 |
self.compare_xml(written, expected) |
self.compare_xml(written, expected) |