Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I developed one tool in arcgis using python code, in the process i used Describe(feature class) function to know the coordinate system of input feature class. I got success while compiling code, But i couldn't get how to set parameters for this function in tool(arcgis 10.0) designing.

I tried parameters as follow

Display  name:input feature class
Data type : coordinate system.
Type   : optional
Direction : input.

My problem is while i'm selecting input feature class, i didn't get coordinate system of that feature class.

Please Suggest..

share|improve this question

1 Answer 1

Well you could use code validation to populate the parameter with the coordinate system of the feature class, using something like the following:

def updateParameters(self):
    fc =  self.params[0].value #Change 0 to refer to parameter number of feature class
    if fc: #Check if value was specified
        #Change 1 to refer to parameter number of coordinate system
        self.params[1].value = arcpy.Describe(fc).SpatialReference.name
    return

Or the easiest way would be to just perform all of this in your actual code, and not worry about populating another parameter.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.