Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following python script which runs perfectly if run separately:

import arcpy 

val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", "")
print str(val)

I want to expose this as a web service and so I installed and wrote the following code for but it gives errors(when invoked. compiles fine).

import web
import arcpy        
urls = (
    '/(.*)', 'hello'
app = web.application(urls, globals())

class hello:        
    def GET(self, name):

        val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", "")
        return  str(val)

if __name__ == "__main__":

When i invoke this using http://localhost:8080, i get the following error:

<class 'arcgisscripting.ExecuteError'> at /
ERROR 000582: Error occurred during execution.

Python  C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\ in GetCellValue, line 8460
Web GET http://localhost:8080/
Traceback (innermost first)

C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\ in GetCellValue
          be returned."""

        retval = convertArcObjectToPythonObject(gp.GetCellValue_management(*gp_fixargs((in_raster, location_point, band_index), True)))
        return retval
    except Exception, e:
        raise e ...
@gptooldoc('GetRasterProperties_management', None)
def GetRasterProperties(in_raster=None, property_type=None):
    """GetRasterProperties_management(in_raster, {property_type})
        Returns the properties of a raster dataset.

I have tried Debugging it in many ways, the code .py runs fine if i just return a "hello". The library i am using is a ArcGIS Geoprocessing toolbox library.

Any ideas as to what might be wrong?

share|improve this question
Maybe try switching your '\' to '/' in the path you specify for your raster dataset. I've had issues with scripts running fine in stand-alone mode, but bombing when run through a script tool in ArcToolbox. To get around it I replaced forward slashes in some key areas with the os.sep function. – Jason Jul 14 '11 at 3:54
I also just noticed that you have a dash ('-') in the path to your raster dataset. I've had problems with dashes under certain circumstances in the past, but I'd doubt it's an issue here though since your stand-alone runs fine. – Jason Jul 14 '11 at 4:01
Does the account running the script have permission to access D:\dem-merged\lidar_wsg84 ? – geographika Jul 14 '11 at 7:20
does it work if you execute the GET function manually? – Matthew Snape Jul 14 '11 at 13:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.