[OSGeo Africa] Need help with python codes

Tim Sutton tim at linfiniti.com
Tue Apr 24 15:47:00 EDT 2012


Hi

On Tue, Apr 24, 2012 at 6:39 PM, Latchman Anand <ablatchman at yahoo.com> wrote:
> Hi All
>
>
> I am new with qgis. Need Help with An error has occured while executing
> Python code
>
>
> Traceback (most recent call last):  File
> "C:/.qgis/python/plugins\gmap_overview_plugin\gmap_gui.py", line 116, in
> onChangeExtent
>     html = html.replace('{scale}',str(self.getZoomScale()))
>   File "C:/.qgis/python/plugins\gmap_overview_plugin\gmap_gui.py", line 134,
> in getZoomScale
>     zoom = np.abs((np.array(zooms) - scale)/scale)
>
> AttributeError: 'NoneType' object has no attribute 'abs'
>
> Python version:
> 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
>
> how can i solve this problem

Probably better to ask on the QGIS developer or users list - hopefully
the plugin authors are subscribed and can help you.

You could just wrap that statement in a try except block like this

zoom = 1
try:
    zoom = np.abs((np.array(zooms) - scale)/scale)
except:
    return


Note I havent looked at the code so have no idea if that will produce
a reasonable outcome.

Regards

Tim

>
>
> Thank you
>
> _______________________________________________
> Africa mailing list
> Africa at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/africa
>



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Visit http://linfiniti.com to find out about:
 * QGIS programming services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Africa mailing list