lgxdw

Using ArcPy Spatial Reference object as input to .net Geoprocessing Tool

Discussion created by lgxdw on May 19, 2014
Latest reply on Jul 8, 2014 by lgxdw
I am creating a custom .net geoprocessing tool. The ESRI geoprocessing tools accept Python SpatialReference Objects as input parameters for projection. How can this be achieved in a custom .net geoprocessing tool? I have tried specifying my parameter data type as both GPSpatialReferenceType and GPCoordinateSystemType and neither work, they give the error "Invalid value type for parameter out_projection" when used with a Python Spatial reference object. In order to use that object you have to call the exportToString() method which I would rather not do as it is not consistent with ESRI. There is no way to interecept the object and convert it to a string because within IGPFunction2.UpdateParameters the parameter value is null

Dim outputParameter As IGPParameterEdit3 = New GPParameterClass()
outputParameter.DataType = CType(New GPSpatialReferenceType(), IGPDataType)


Thanks
David

Outcomes