Koblitz,<div><br></div><div>Coloque o caminho completo na fonte.</div><div>srcShapefile = &#39;/caminho_da_fonte/us08.shp&#39;</div><div>shapefile=osgeo.ogr.Open(srcShapefile) <br></div><div><br></div><div>Só nome do arquivo não é suficiente, assim, a função Open retornou &#39;None&#39;.</div>
<div><br></div><div>Como vc. está no QGIS, geralmente usamos os layer que estão no projeto e a API do QGIS p/ obter as informações dos mesmos.</div><div><br><br><div class="gmail_quote">Em 15 de março de 2012 15:30, Rodrigo Koblitz <span dir="ltr">&lt;<a href="mailto:rodrigokoblitz@yahoo.com.br">rodrigokoblitz@yahoo.com.br</a>&gt;</span> escreveu:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">Buenos, <br>estou confuso aqui com as diferentes formas de se programar, linha de comando, em GIS. Via QGIS.<br>
<br>quando estou no console Python no qgis, existem classes (ou funcoes) que utilizo que não servem no shell normal, fora do qgis?<br><br>No shell do linux, faço algo do tipo:<br>&gt;&gt;&gt; shapefile=osgeo.ogr.Open(&#39;us08.shp&#39;);layer=shapefile.GetLayer();numfeatures=layer.GetFeatureCount()<br>
<br>e ok,<br><br>mas no shelll python do qgis, o &#39;Open&#39; é entendido, mas não o GetLayer<br>

<p style="margin:0px;text-indent:0px">AttributeError: &#39;NoneType&#39; object has no attribute &#39;GetLayer&#39;</p><p style="margin:0px;text-indent:0px"><br></p><p style="margin:0px;text-indent:0px">é uma questão de modulo a ser importado? O qgis tem o &#39;qgis.utils....&#39;  e o python no shell linux não tem?</p>
<p style="margin:0px;text-indent:0px"><br></p><p style="margin:0px;text-indent:0px">abs,</p><p style="margin:0px;text-indent:0px">Koblitz<br></p><p style="margin:0px;text-indent:0px"><br></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
<br></p><br></td></tr></tbody></table><br>_______________________________________________<br>
Brasil mailing list<br>
<a href="mailto:Brasil@lists.osgeo.org">Brasil@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/brasil" target="_blank">http://lists.osgeo.org/mailman/listinfo/brasil</a><br>
<br></blockquote></div><br></div>