ArcGIS image server - extracting images with python

4898
5
08-07-2012 09:44 AM
by Anonymous User
Not applicable
I am trying to write some python code to reference an image service. The entire code is below but the local variable statement is
KYLiDARData = "http:\\kyraster.ky.gov\\ArcGIS\\rest\\services\\ElevationServices\\RegionalMosaic\\ImageServer"  .   When i run it i get the error ERROR 000865: Input raster: http:\kyraster.ky.gov\ArcGIS\rest\services\ElevationServices\RegionalMosaic\ImageServer does not exist.  But if I past that web page it goes right to the page it works in a browser.  I'm confused. 

I would appreciate anyone who could help me reference this image service correctly. 

Thanks,
Tom


The full code is below
# ---------------------------------------------------------------------------
# iterate_lidar_grab3.py
# Created on: 2012-08-07 12:51:10.00000
#   (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")


# Local variables:
KYLiDARData = "http:\\kyraster.ky.gov\\ArcGIS\\rest\\services\\ElevationServices\\RegionalMosaic\\ImageServer"
ClipFeatures = "D:\\Mueller_UK\\Projects\\SuperComputer\\2.shp"
Tom_B_test = "D:\\Mueller_UK\\Projects\\SuperComputer\\KY_Lidar\\Tom_B_test_2"

# Process: Extract by Mask (2)
arcpy.gp.ExtractByMask_sa(KYLiDARData, ClipFeatures, Tom_B_test)
0 Kudos
5 Replies
NelsonDe_Miranda
Occasional Contributor III
You may want to reference this clip and ship example:

http://www.arcgis.com/home/item.html?id=d250f327d93b42f2ad8555b5b99f1458

Cheers,
Nelson
0 Kudos
by Anonymous User
Not applicable
Thank you Nelson.  This looks like what exactly what want but it looks like it is for ArcGIS 10.1.   Do you think this is stable enough yet to migrate to.
0 Kudos
NelsonDe_Miranda
Occasional Contributor III
I've been working with 10.1 quite a bit recently and i've found it to be much more stable than 10.0 was at launch.

You may want to set up a test server to see how it works with your current environment.

Cheers,

Nelson
0 Kudos
by Anonymous User
Not applicable
Thanks Nelson, I installed 10.1 yesterday and it dodn't crash any more than 10.0.  I like the new feel to it.  

I tried clip and ship but it did not work and I did not get informative errors.  Have you tried it.   I think it may be related to how I have my web service specified but I can't tell for sure.

I've been working with 10.1 quite a bit recently and i've found it to be much more stable than 10.0 was at launch.

You may want to set up a test server to see how it works with your current environment.

Cheers,

Nelson
0 Kudos
PeterBecker
Esri Regular Contributor
To make requests using Python you need to
1. use the soap url (without �??rest/�?�)
2. Make image server layer
3. Use the imageserverlayer as input

see the following blog post on getting a geoprocessing service to work with image services: http://blogs.esri.com/esri/arcgis/2011/02/01/designing-a-geoprocessing-service-to-work-with-image-se...
0 Kudos