I have a model that works fine in ArcMap for converting to KML, but when I publish it as a geoprocessing service, only the first attempt from a web application works. All following attempts return KML files with commas instead of points in their geometries:
First run : -72.5123508930792,46.02718407088821,0 -72.89026165964782,45.9512204096942,0 -73.00197113196214,45.60643088717575,0
Second run : -72,5123508930792,46,02718407088821,0 -72,89026165964782,45,9512204096942,0 -73,00197113196214,45,60643088717575,0
I believe that changing the locale setting (decimal delimiter) of the arcGIS server machine might fix this issue, but changing it permanently is simply not an option. I need to find an alternative.
I have tried exporting the model to python and editing the script to change the locale with python (and then return it to its original locale):
locale.setlocale(locale.LC_ALL,"english")
arcpy.LayerToKML_conversion(sourceLayer, kmzFileName, "1", "false", "DEFAULT", "1024", "96", "CLAMPED_TO_GROUND")
locale.setlocale(locale.LC_ALL,"")
as outlined here: https://community.esri.com/thread/110968
But this doesnt seem to work.
Does anyone know of a way to manually override the way ArcGIS Server/arcpy.LayerToKML_conversion uses the system locale/decimal delimiter?