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

396
0
12-15-2016 11:37 AM
davidzornosa
New Contributor III

Hello

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

Tags (1)
0 Kudos
0 Replies