How to use a REST service in Python - DownloadRasters_management

1857
10
05-31-2018 10:34 AM
BobBistrais
New Contributor III

I am writing a Python script with uses the DownloadRasters_management tool.  I want to use an Image Service from one of our servers as the input.  According to the documentation, the format is:

arcpy.DownloadRasters_management (in_image_service, out_folder, {where_clause}, {selection_feature}, {clipping}, {convert_rasters}, {format}, {compression_method}, {compression_quality}, {MAINTAIN_FOLDER})

for the in_image_service, I entered the URL to the service in quotes, e.g. "https://myserver/myimageservice/ImageServer"

-When I run the script, I get an error message "pythonw.exe has stopped working.  A problem caused the program to stop working correctly.  Please close the program".

-I also tried using the same URL to the service in ArcGIS Desktop, DownlaodRasters_management tool.  This gives me the message that the tool ran "successfully", but in fact, there is no output.

Any suggestions on how to properly format the URL to the service? 

0 Kudos
10 Replies
PrasanthRamachandran2
New Contributor II

Hey Bob Bistrais‌ & Joshua Bixby,

I believe it could be authentication error because I am facing similar kind of an issue and details are in this post. If you guys had identified this issue earlier and resolved it, can you please let me know the solution or any work around if it is available. 

0 Kudos