178 |
|
|
179 |
for d in descr: |
for d in descr: |
180 |
if d.required and not attrs.has_key(d.fullname): |
if d.required and not attrs.has_key(d.fullname): |
181 |
pass |
raise LoadError("Element %s requires an attribute %r" |
182 |
#raise LoadError("Element %s requires an attribute %r" |
% (element, d.name)) |
|
# % (element, d.name)) |
|
183 |
value = attrs.get(d.fullname, d.default) |
value = attrs.get(d.fullname, d.default) |
184 |
|
|
185 |
if d.conversion == "shapesource": |
if d.conversion == "shapesource": |
276 |
|
|
277 |
def start_map(self, name, qname, attrs): |
def start_map(self, name, qname, attrs): |
278 |
"""Start a map.""" |
"""Start a map.""" |
279 |
self.aMap = Map(attrs.get((None, 'title'), None)) |
self.aMap = Map(self.encode(attrs.get((None, 'title'), None))) |
280 |
|
|
281 |
def end_map(self, name, qname): |
def end_map(self, name, qname): |
282 |
self.theSession.AddMap(self.aMap) |
self.theSession.AddMap(self.aMap) |
362 |
elif fieldType == FIELDTYPE_DOUBLE: |
elif fieldType == FIELDTYPE_DOUBLE: |
363 |
self.conv = float |
self.conv = float |
364 |
|
|
365 |
self.aLayer.GetClassification().SetFieldInfo(field, fieldType) |
self.aLayer.SetClassificationColumn(field) |
366 |
|
|
367 |
def end_classification(self, name, qname): |
def end_classification(self, name, qname): |
368 |
pass |
pass |
380 |
def start_clpoint(self, name, qname, attrs): |
def start_clpoint(self, name, qname, attrs): |
381 |
attrib_value = attrs.get((None, 'value'), "0") |
attrib_value = attrs.get((None, 'value'), "0") |
382 |
|
|
383 |
value = self.conv(attrib_value) |
field = self.aLayer.GetClassificationColumn() |
384 |
|
if self.aLayer.GetFieldType(field) == FIELDTYPE_STRING: |
385 |
|
value = self.encode(attrib_value) |
386 |
|
else: |
387 |
|
value = self.conv(attrib_value) |
388 |
self.cl_group = ClassGroupSingleton(value) |
self.cl_group = ClassGroupSingleton(value) |
389 |
self.cl_group.SetLabel(self.encode(attrs.get((None, 'label'), ""))) |
self.cl_group.SetLabel(self.encode(attrs.get((None, 'label'), ""))) |
390 |
self.cl_prop = ClassGroupProperties() |
self.cl_prop = ClassGroupProperties() |