Skip to Content.

mget-help - RE: [mget-help] Problem calculating diversity index with single polygon

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


RE: [mget-help] Problem calculating diversity index with single polygon


Chronological Thread 
  • From: Jason Roberts <>
  • To: Euan Forsyth <>
  • Cc: "" <>
  • Subject: RE: [mget-help] Problem calculating diversity index with single polygon
  • Date: Thu, 28 Jan 2016 23:15:35 +0000
  • Accept-language: en-US
  • Authentication-results: spf=none (sender IP is ) ;
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:23

Hi Euan,

 

Thank you for reporting this problem, and for reporting the complete output of the tool along with data that reproduce it. I am sorry it has cropped up again. It is a bug in MGET. Attached is a file that fixes the problem. Could you please:

 

1.    Close all ArcGIS programs.

2.    Replace the file C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\SpatialAnalysis\Diversity.py with the attached one. Unfortunately you may need to be admin on the machine to do this.

3.    Retry the problem.

 

Please let me know how it goes. This fix will appear in MGET 0.8a62 and later.

 

Best,

Jason

 

From: [mailto:] On Behalf Of Euan Forsyth
Sent: Wednesday, January 27, 2016 11:40 PM
To:
Subject: [mget-help] Problem calculating diversity index with single polygon

 

Hi,

 

The diversity index is exactly what I need, but, as per the title, I'm having a problem executing it. Specifically, the tool seems to encounter a problem when bringing the results back to ArcMap (10.3.1). The full error log is quoted at the end of the email.

 

A similar (identical?) issue was raised in 2013. Following on from the troubleshooting there, I created a second random zone of interest polygon. This, unfortunately, did not alleviate the situation.

 

The other solution mooted there was that maybe it's something to do with R? I've not tried downgrading our version of R (3.1.1) just yet, as I do not have admin rights to the machine. As such, I'd rather have a confirmation that this is the case before dragging IT into the situation!

 

I've attached the sample data I was testing on, if that is of any use.

 

Many thanks for any help,

Euan Forsyth

 

----------

 

Executing: SpeciesDiversityCalculateDiversityIndexForArcGISPolygons Area_Test "Shannon index" LUM LandUse_Test LANDUSE # # #

Start Time: Thu Jan 28 14:11:37 2016

Running script SpeciesDiversityCalculateDiversityIndexForArcGISPolygons...

Intersecting the points with the polygons.

Summing species counts per polygon.

Reading species counts into memory.

Query complete: 0:00:00 elapsed, 19 rows retrieved, 0:00:00.007421 per row.

Writing species diversity index values to the polygons.

Update stopped before all rows were processed: 0:00:00 elapsed, 0 rows updated, 0 deleted, 1 unchanged, 0:00:00 per row, 1 rows not processed.

AttributeError: 'float' object has no attribute 'has_key'

Failed script SpeciesDiversityCalculateDiversityIndexForArcGISPolygons...

 

Traceback (most recent call last):

  File "C:\Program Files\GeoEco\ArcGISToolbox\Scripts\SpeciesDiversityCalculateDiversityIndexForArcGISPolygons.py", line 5, in <module>

    ExecuteMethodFromCommandLineAsArcGISTool('GeoEco.SpatialAnalysis.Diversity', 'SpeciesDiversity', 'CalculateDiversityIndexForArcGISPolygons')

  File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\ArcGISScripts.py", line 210, in ExecuteMethodFromCommandLineAsArcGISTool

    exec sourceCode in globals(), locals()

  File "<string>", line 1, in <module>

  File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\SpatialAnalysis\Diversity.py", line 158, in CalculateDiversityIndexForArcGISPolygons

    if indexValues.has_key(fidStr):

AttributeError: 'float' object has no attribute 'has_key'

 

Failed to execute (SpeciesDiversityCalculateDiversityIndexForArcGISPolygons).

Failed at Thu Jan 28 14:11:42 2016 (Elapsed Time: 4.71 seconds)

Attachment: Diversity.py
Description: Diversity.py




Archive powered by MHonArc 2.6.19.

Top of Page