AnsweredAssumed Answered

how do i get python geoservice ExportToJPEG to return image as a job result

Question asked by davidzornosa on Dec 15, 2016



I have an asynchronous geoprocessing service written in python that takes a layer from a  mapservice and generates a jpeg image out of it.


To achieve this i am using ExportToJPEG


I need said geoprocessing service to return the image as a job result. How can i achieve that?


thank you


import arcpy


q ={
"mapOptions": {
"extent": {
            "xmin" : -79.50,
            "ymin" : -4.60,
            "xmax" : -66.50,
            "ymax" : 12.8,
            "spatialReference" : {
                "wkid" : 4686
"operationalLayers": [{ "url":"....."}]      
result = arcpy.mapping.ConvertWebMapToMapDocument(q);
arcpy.mapping.ExportToJPEG(result.mapDocument, path_to_image)
del result