10 |
import os |
import os |
11 |
from math import log, ceil |
from math import log, ceil |
12 |
|
|
13 |
|
from Thuban import _ |
14 |
|
|
15 |
import shapelib, shptree |
import shapelib, shptree |
16 |
|
|
17 |
from messages import LAYER_PROJECTION_CHANGED, LAYER_LEGEND_CHANGED, \ |
from messages import LAYER_PROJECTION_CHANGED, LAYER_LEGEND_CHANGED, \ |
268 |
items = [] |
items = [] |
269 |
|
|
270 |
if self.Visible(): |
if self.Visible(): |
271 |
items.append("Shown") |
items.append(_("Shown")) |
272 |
else: |
else: |
273 |
items.append("Hidden") |
items.append(_("Hidden")) |
274 |
items.append("Shapes: %d" % self.NumShapes()) |
items.append(_("Shapes: %d") % self.NumShapes()) |
275 |
|
|
276 |
bbox = self.LatLongBoundingBox() |
bbox = self.LatLongBoundingBox() |
277 |
if bbox is not None: |
if bbox is not None: |
278 |
items.append("Extent (lat-lon): (%g, %g, %g, %g)" % bbox) |
items.append(_("Extent (lat-lon): (%g, %g, %g, %g)") % bbox) |
279 |
else: |
else: |
280 |
items.append("Extent (lat-lon):") |
items.append(_("Extent (lat-lon):")) |
281 |
items.append("Shapetype: %s" % shapetype_names[self.ShapeType()]) |
items.append(_("Shapetype: %s") % shapetype_names[self.ShapeType()]) |
282 |
|
|
283 |
def color_string(color): |
def color_string(color): |
284 |
if color is None: |
if color is None: |
285 |
return "None" |
return "None" |
286 |
return "(%.3f, %.3f, %.3f)" % (color.red, color.green, color.blue) |
return "(%.3f, %.3f, %.3f)" % (color.red, color.green, color.blue) |
|
items.append("Fill: " + color_string(self.fill)) |
|
|
items.append("Outline: " + color_string(self.stroke)) |
|
287 |
|
|
288 |
return ("Layer '%s'" % self.Title(), items) |
# layers will always have a classification with at least a NULL data set |
289 |
|
|
290 |
|
#items.append((_("Fill: %s") % color_string(self.fill), self.fill)) |
291 |
|
#items.append((_("Outline: %s") % color_string(self.stroke), self.stroke)) |
292 |
|
|
293 |
|
items.append(self.classification) |
294 |
|
|
295 |
|
return (_("Layer '%s'") % self.Title(), items) |
296 |
|
|