<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html;">
<title>Scalix message content</title>
<style type="text/css">
<!--
.Normal {  text-align: left; text-indent:0pt; margin-top:0pt; margin-bottom:0pt; font-family: Arial; font-size: 12pt; }
.Default_Paragraph_Font {font-family: Arial; color: Black; background-color: white ; font-size: 12pt; font-weight: normal;  font-style: normal; font-variant: normal; vertical-align: normal; text-decoration: none;}
div.ltTOCtitle { font-family: Verdana; font-size: 8pt; font-weight: bold; text-align: center;}
div.ltTOCl1 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:32pt; text-indent:-32pt;}
div.ltTOCl2 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:40pt; text-indent:-32pt;}
div.ltTOCl3 {  font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:48pt; text-indent:-32pt;}
div.ltTOCl4 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:56pt; text-indent:-32pt;}
div.ltTOCl5 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:64pt; text-indent:-32pt;}
div.ltTOCl6 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:72pt; text-indent:-32pt;}
-->
</style>
</head>

<body>
<div class="Normal"><span style='font-size: 10pt; '>Barry,</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Yep that's exactly the
solution for my problem. Thank you very much.</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Regards
</span><br><span style='font-size: 10pt; '>Horst</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>------------------------------------------------</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Dr. Horst
D&uuml;ster</span><br><span style='font-size: 10pt; '>GIS-Koordinator, Stv.
Amtschef</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Kanton
Solothurn</span><br><span style='font-size: 10pt; '>Bau- und
Justizdepartement</span><br><span style='font-size: 10pt; '>Amt f&uuml;r
Geoinformation</span><br><span style='font-size: 10pt; '>SO!GIS
Koordination</span><br><span style='font-size: 10pt; '>R&ouml;tistrasse
4</span><br><span style='font-size: 10pt; '>CH-4501 Solothurn</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Telefon ++41(0)32 627 25
32</span><br><span style='font-size: 10pt; '>Telefax ++41(0)32 627 22
14</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>mailto:horst.duester@bd.so.ch</span><br><span style='font-size: 10pt; '>http://www.agi.so.ch</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>-----Urspr&uuml;ngliche
Nachricht-----</span><br><span style='font-size: 10pt; '>Von: Barry Rowlingson
[mailto:b.rowlingson@lancaster.ac.uk]</span><br><span style='font-size: 10pt; '>Gesendet
am: Freitag, 11. Januar 2008 11:40</span><br><span style='font-size: 10pt; '>An:
D&uuml;ster Horst</span><br><span style='font-size: 10pt; '>Cc:
qgis-developer</span><br><span style='font-size: 10pt; '>Betreff: Re:
[Qgis-developer] QgsMapLayerRegistry.mapLayers()
not</span><br><span style='font-size: 10pt; '>available in Python
Bindings</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>D&uuml;ster Horst
wrote:</span><br><span style='font-size: 10pt; '>&gt; With Python I want to get
all avalilable map layers from my
current</span><br><span style='font-size: 10pt; '>&gt; project. I tried to do
this with </span><br><span style='font-size: 10pt; '>&gt;
</span><br><span style='font-size: 10pt; '>&gt; layerCollection =
QgsMapLayerRegistry().instance().mapLayers()</span><br><span style='font-size: 10pt; '>&gt;
</span><br><span style='font-size: 10pt; '>&gt; It doesn't work. I took a look
into qgsmaplayerregistry.sip and
found</span><br><span style='font-size: 10pt; '>&gt; out that the method
mapLayers() is not wrapped until now. What is to
do</span><br><span style='font-size: 10pt; '>&gt; to wrap this method. Does
exists a workareound to retrieve all
project</span><br><span style='font-size: 10pt; '>&gt; layers.</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>You can get all the layers
in the current map canvas from the console thus:</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '># get the map
canvas</span><br><span style='font-size: 10pt; '>mc=iface.getMapCanvas()</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '># how many layers are
there?</span><br><span style='font-size: 10pt; '>nLayers=mc.layerCount()</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '># loopage:</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>for l in
range(nLayers):</span><br><span style='font-size: 10pt; '>   layer =
mc.getZpos(l)</span><br><span style='font-size: 10pt; '>  
doSomethingWith(layer)</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>  - is that good
enough?</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Barry</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>_______________________________________________</span><br><span style='font-size: 10pt; '>Qgis-developer
mailing
list</span><br><span style='font-size: 10pt; '>Qgis-developer@lists.qgis.org</span><br><span style='font-size: 10pt; '>http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer</span></div>



</body>

</html>