AnsweredAssumed Answered

Layer to KML GP Service using commas for coordinates instead of points

Question asked by JWDavies on Apr 27, 2018

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 possibly 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: Layer to KML faulty output 

 

But this doesnt seem to work when it is published to arcGIS server.

 

Does anyone know of a way to manually override the way arcGIS server uses the system locale/decimal delimiter?

 

Any help is appreciated!

 

Regards,

 

Joe

Outcomes