Optimized hotspot analysis (ArcGIS Desktop 10.5.1) tool failing to excecutet gives me the following

1931
7
07-13-2017 04:23 AM
FrancoisBekker
New Contributor

Hi Guys,

I have 399 incidence points on which I would like to run Optimised Hotspot Analysis with the aggregate into fishnet option selected. The goal is to determine the polygon size (fishnet block size). When running the tool in ArcGIS 10.5.1 it gives me the following output:

Executing: OptimizedHotSpotAnalysis TRAP_LOCATIONS_EGVV_UTM_WG_84 "E:\Academic\ArcGIS_Files\EGVVProject2017CorrectProjection\Analysis Locations etc\Trap_Icidence_Hotspots.shp" # COUNT_INCIDENTS_WITHIN_FISHNET_POLYGONS # # # # #
Start Time: Thu Jul 13 12:24:18 2017
Running script OptimizedHotSpotAnalysis...

************************** Initial Data Assessment ***************************
Making sure there are enough incidents for analysis....
    - There are 399 valid input features.

Looking for locational outliers....
    - There were 3 outlier locations; these will not be used to compute the polygon cell size.

**************************** Incident Aggregation ****************************
Creating fishnet polygon mesh to use for aggregating incidents....
Failed script OptimizedHotSpotAnalysis...

Traceback (most recent call last):
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 1276, in <module>
    setupOptHotSpot()
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 292, in setupOptHotSpot
    bandSize2Use = processingBandSize)
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 353, in __init__
    self.initialize()
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 384, in initialize
    self.doGrid()
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 698, in doGrid
    cellSize, boundaryExtent)
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 792, in aggregation
    self.createMesh(outputFC, [locationField, countField], spatialRef, mask)
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 835, in createMesh
    xyDomain = [UTILS.strToFloat(i) for i in spatialRef.domain.split(" ")]
  File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcToolBox\Scripts\SSUtilities.py", line 119, in strToFloat
    return LOCALE.atof(floatAsStr)
  File "C:\Python27\ArcGIS10.5\Lib\locale.py", line 312, in atof
    string = string.replace(ts, '')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 0: ordinal not in range(128)

Failed to execute (OptimizedHotSpotAnalysis).
Failed at Thu Jul 13 12:24:19 2017 (Elapsed Time: 0,89 seconds)

These are the points that I want to use for the analysis.

Can anyone please help me?

Kind Regards

Gulu

0 Kudos
7 Replies
JenoraD_Acosta
Occasional Contributor

Hello!

I am moving this to Spatial Stats and will look into it in the morning.  Can you tell me if you are using a language pack?  

-Jenora

0 Kudos
DanPatterson_Retired
MVP Emeritus

I have looked at it, and this seems to be the root issue.

OriGudes2
New Contributor III

Did you try running it from a shorter pathway, let's say: c/temp/yourfolder, any other errors?

0 Kudos
AnnDonald
New Contributor

I am getting the same error. Any approaches to solve this?

0 Kudos
JenoraD_Acosta
Occasional Contributor

Hi!  Can you tell me if you are using a language pack?

0 Kudos
JimmyHolm
New Contributor

I seem to be running into the same issue. Still no clue as to what is causing this?

Posting my output below. Running 10.5.1, not using any language pack so that is not the issue here.

************************** Initial Data Assessment ***************************
Making sure there are enough incidents for analysis....
    - There are 1087 valid input features.

Looking for locational outliers....
    - There were 4 outlier locations; these will not be used to compute the hexagon size.

**************************** Incident Aggregation ****************************
Creating hexagon mesh to use for aggregating incidents....
Failed script OptimizedHotSpotAnalysis...

Traceback (most recent call last):
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 1304, in <module>
    setupOptHotSpot()
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 292, in setupOptHotSpot
    bandSize2Use = processingBandSize)
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 353, in __init__
    self.initialize()
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 384, in initialize
    self.doGrid()
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 699, in doGrid
    cellSize, boundaryExtent)
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 793, in aggregation
    self.createMesh(outputFC, [locationField, countField], spatialRef, mask)
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\OptimizedHotSpotAnalysis.py", line 836, in createMesh
    xyDomain = [UTILS.strToFloat(i) for i in spatialRef.domain.split(" ")]
  File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\SSUtilities.py", line 165, in strToFloat
    return LOCALE.atof(floatAsStr)
  File "C:\Python27\ArcGIS10.5\Lib\locale.py", line 312, in atof
    string = string.replace(ts, '')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 0: ordinal not in range(128)

Failed to execute (OptimizedHotSpotAnalysis).
Failed at Mon May 07 13:48:42 2018 (Elapsed Time: 3,47 seconds)

0 Kudos
JenoraD_Acosta
Occasional Contributor

Hello Jimmy, I had the programmer take a look at this issue and it seems that the issue lies in the xyDomain variable ... there seems to be a Unicode character inside it.  This variable needs to be able to be transformed from a string to a float.  You could try to change only the bolded line below in the code for the tool and see if that fixes it.  It would also help if you provided the data that you are using, a portion of the data with the spatial reference that is causing the traceback or at least letting us know the spatial reference you are using so we can look into it and try to fix it for the future.  Let us know if this works for you!  Thank you!

-Jenora

def strToFloat(floatAsStr😞

    """Robust Methodology to Convert to and From Alternative Locale Decimals.

 

    INPUT:

    floatAsStr (str): numeric rep of a float

 

    RETURN:

    value (float): resulting float

    """

 

    if isNumeric(floatAsStr😞

        return float(floatAsStr)

    else:

        sep = LOCALE.localeconv()['decimal_point']

        sepTypes = [",", "."]

        sepTypes.remove(sep)

        if sep in floatAsStr:

            return LOCALE.atof(UTILS.decodeString(floatAsStr))

        else:

            if sepTypes[0] in floatAsStr:

                newStr = floatAsStr.replace(sepTypes[0], sep)

                return LOCALE.atof(newStr)

            else:

                return float(floatAsStr)