0

I am trying to run the ExportHTMLImageMaps tool in ArcGIS 10.3.1 to create HTML image maps to be used as static web geographic navigation maps, but I keep getting the Error TypeError: cannot concatenate 'str' and 'NoneType' objects

I checked each field being used in the tool and each is type String, so I'm not sure where to go from here. Below is a screen cap of my error log. I am a novice at Python and troubleshooting code.

enter image description here

5

Looking at your screen shot and reading the error message it is saying it cannot join None to a string. This is strongly suggesting that the command

arcpy.env.geographicTransformations

is returning None. So you need to look back at your code to identify where, if at all, you are setting this environment setting?

  • I'm just running the tool in ArcMap, not editing any Python code... so I' don't know if I have the option to set this environment setting. If you want to try running the tool, here's where to download it: arcgis.com/home/item.html?id=9d94067ccf11466f8dfcc6b78064c4dc – mmerrill Oct 9 '17 at 21:22
  • @mmerrill have a look at the source code in ExportHTMLImageMaps.py from lines 472-486, they discuss the error and possible solutions. – Hornbydd Oct 9 '17 at 22:11
  • I'm still not sure how to proceed. On the message board referenced in the Python code, an ESRI person says the df.geographicTransformations issue should be fixed in version 10.1 (I'm in 10.3.1). Both the data frame and the layer I'm using have coordinate systems of NAD_1983_UTM_Zone_15N – mmerrill Oct 11 '17 at 23:20
2

@Hornbydd is correct and that answer should be accepted. That's the error we get with Python 2 if we try to add two values and one is None.

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 12:54:16)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "message" + None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot concatenate 'str' and 'NoneType' objects

With Python 3 we also get a TypeError but the message has changed.

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "message" + None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Can't convert 'NoneType' object to str implicitly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.