<!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; '>Martin,</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Thank you very much for your
response. I think for my purposes mapLayers() would be a good solution. So I'll
wait for the wrapped method.</span></div>
<br>
<div class="Normal"><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: Martin Dobias
[mailto:wonder.sk@gmail.com]</span><br><span style='font-size: 10pt; '>Gesendet
am: Freitag, 11. Januar 2008 11:57</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; '>On Jan 11, 2008 11:01 AM,
D&uuml;ster Horst &lt;Horst.Duester@bd.so.ch&gt;
wrote:</span><br><span style='font-size: 10pt; '>&gt;</span><br><span style='font-size: 10pt; '>&gt;</span><br><span style='font-size: 10pt; '>&gt;
With Python I want to get all avalilable map layers from my current
project.</span><br><span style='font-size: 10pt; '>&gt; 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
out</span><br><span style='font-size: 10pt; '>&gt; that the method mapLayers()
is not wrapped until now. What is to do to
wrap</span><br><span style='font-size: 10pt; '>&gt; this method. Does exists a
workareound to retrieve all project layers.</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Hi,</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>this function isn't wrapped
so far because mapLayers() uses
std::map</span><br><span style='font-size: 10pt; '>container which should be
replaced with QMap instead. It's not a
lot</span><br><span style='font-size: 10pt; '>of work, I'll do it probably
soon.</span><br><span style='font-size: 10pt; '>Please note that theoretically
QgsMapLayerRegistry can contain
also</span><br><span style='font-size: 10pt; '>layers which are not part of the
project (e.g. when using</span><br><span style='font-size: 10pt; '>georeferencer
plugin it adds temporarily a layer to the registry).</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>In fact there is currently
no way how to directly access all
project's</span><br><span style='font-size: 10pt; '>layers correctly, since map
canvas doesn't keep list of all
layers</span><br><span style='font-size: 10pt; '>(only those which are visible)
and it's not possible to access
legend</span><br><span style='font-size: 10pt; '>from the plugin as it's not
part of QGIS libraries :-/</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>One workaround would be to
save the project and then use
legend's</span><br><span style='font-size: 10pt; '>nodes to parse the list of
layers, which is, well, quite
inconvenient.</span><br><span style='font-size: 10pt; '>We should definitely do
something with this. I guess for now
wrapping</span><br><span style='font-size: 10pt; '>mapLayers() would do
it...</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Regards</span><br><span style='font-size: 10pt; '>Martin</span></div>



</body>

</html>