Skip to Content.

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

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


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


Chronological Thread 
  • From: Euan Forsyth <>
  • To:
  • Subject: [mget-help] Problem calculating diversity index with single polygon
  • Date: Thu, 28 Jan 2016 17:40:14 +1300

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: MGET Help.zip
Description: Zip archive




Archive powered by MHonArc 2.6.19.

Top of Page