<br><br><div class="gmail_quote"><div>Oi Rodrigo,</div>O erro mostra que:<div>osgeo.ogr.Open('us08.shp') retornou NoneType, ou seja, não retornou um objeto <DataSource> que possuiria o método GetLayer.</div>
<div>isto quer dizer que o ogr não conseguiu abrir o arquivo, provavelmente devido ao caminho incorreto. O ogr não emite erros do tipo "arquivo não encontrado" ou "arquivo inválido" levando a confusão.</div>
<div><br></div><div>Experimente colocar o caminho completo para o arquivo.</div><div><br></div><div>Att,</div><div>Pablo.</div><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">Em 15 de março de 2012 15:30, Rodrigo Koblitz <span dir="ltr"><<a href="mailto:rodrigokoblitz@yahoo.com.br" target="_blank">rodrigokoblitz@yahoo.com.br</a>></span> escreveu:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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>>>> shapefile=osgeo.ogr.Open('us08.shp');layer=shapefile.GetLayer();numfeatures=layer.GetFeatureCount()<br>
<br>e ok,<br><br>mas no shelll python do qgis, o 'Open' é entendido, mas não o GetLayer<br>
<p style="margin:0px;text-indent:0px">AttributeError: 'NoneType' object has no attribute 'GetLayer'</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 'qgis.utils....' 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></div></div>_______________________________________________<br>
Brasil mailing list<br>
<a href="mailto:Brasil@lists.osgeo.org" target="_blank">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><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Pablo T. Carreira<br><a href="tel:19%2093462359" value="+551993462359" target="_blank">19 93462359</a><br><br>
</font></span></div>
</div><br><br clear="all"><div><br></div>-- <br>Pablo T. Carreira<br>19 93462359<br><br>