210 |
"""Write the projection. |
"""Write the projection. |
211 |
""" |
""" |
212 |
if projection and len(projection.params) > 0: |
if projection and len(projection.params) > 0: |
213 |
self.open_element("projection") |
self.open_element("projection", |
214 |
|
{"name": escape(projection.GetName())}) |
215 |
for param in projection.params: |
for param in projection.params: |
216 |
self.write_element('parameter value="%s"' % escape(param)) |
self.write_element('parameter value="%s"' % escape(param)) |
217 |
self.close_element("projection") |
self.close_element("projection") |
233 |
attrs["stroke"] = lc.GetDefaultLineColor().hex() |
attrs["stroke"] = lc.GetDefaultLineColor().hex() |
234 |
attrs["stroke_width"] = str(lc.GetDefaultLineWidth()) |
attrs["stroke_width"] = str(lc.GetDefaultLineWidth()) |
235 |
attrs["fill"] = lc.GetDefaultFill().hex() |
attrs["fill"] = lc.GetDefaultFill().hex() |
236 |
|
attrs["visible"] = ("false", "true")[int(layer.Visible())] |
237 |
|
|
238 |
self.open_element("layer", attrs) |
self.open_element("layer", attrs) |
239 |
|
|
240 |
|
proj = layer.GetProjection() |
241 |
|
if proj is not None: |
242 |
|
self.write_projection(proj) |
243 |
|
|
244 |
self.write_classification(layer) |
self.write_classification(layer) |
245 |
|
|
246 |
self.close_element("layer") |
self.close_element("layer") |
247 |
|
|
248 |
def write_classification(self, layer, attrs = None): |
def write_classification(self, layer, attrs = None): |