Koblitz,<div><br></div><div>Coloque o caminho completo na fonte.</div><div>srcShapefile = '/caminho_da_fonte/us08.shp'</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 'None'.</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"><<a href="mailto:rodrigokoblitz@yahoo.com.br">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"><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>_______________________________________________<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>