AnsweredAssumed Answered

Sharing geoprocessing tool that converts layers to KMZ

Question asked by ahmadabusaleh on Oct 20, 2017

Hello,

I wrote a tool that converts a layer to KMZ and its working fine at the level of Arcmap, then I shared the result as a geoprocessing service and tried to run the tool from the services list in catalog, but it fails when I checked the arcgis server logs I can see this message:

 

Error executing tool. kmztool20 Job ID: jc04a8eca6ae74077ae03f863053581c7 : Traceback (most recent call last): File "C:\arcgisserver\directories\arcgissystem\arcgisinput\kmztool20.GPServer\extracted\v101\kmz_tool\module2.py", line 17, in arcpy.LayerToKML_conversion(Inlayer, out_kmz_file, layer_output_scale="0", is_composite="NO_COMPOSITE", boundary_box_extent="DEFAULT", image_size="1024", dpi_of_client="96", ignore_zvalue="CLAMPED_TO_GROUND") File "c:\program files\arcgis\server\arcpy\arcpy\conversion.py", line 2322, in LayerToKML raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Layer: Dataset in_memory\{6EAD8FB0-24C6-4EAC-9386-CFCA13A78657} does not exist or is not supported Failed to execute (LayerToKML). Failed to execute (kmztool20). Failed to execute (kmztool20).

Here is my script:

import arcpy, os

Inlayer=arcpy.GetParameterAsText(0)
out_kmz_file=arcpy.GetParameterAsText(1)

arcpy.LayerToKML_conversion(Inlayer, out_kmz_file, layer_output_scale="0", is_composite="NO_COMPOSITE", boundary_box_extent="DEFAULT", image_size="1024", dpi_of_client="96", ignore_zvalue="CLAMPED_TO_GROUND")

 

What might be the issue here

 

Thanks a lot,

Ahmad

Outcomes