How to set Geoprocessing field_mapping parameter in SDK

151
1
Jump to solution
11-13-2017 02:27 AM
Highlighted
New Contributor III

Is it possible to set the fieldmappings parameter for spatial-join (or another geoprocessor) from the sdk?

In Arcobjects you would use the IGPFieldMapping object and in Python the arcpy.FieldMappings object.

 

I Only want/need 1 field from join_features. 

I can't find anything about this topic in the SDK documentation, and the community samples only use simple string based parameters.

Is there a renamed object that I'm missing, or is this functionality missing from ArcGIS Pro .Net SDK?

Removing/renaming the unused fields afterwards is not an acceptable workaround (There are way to many fields for this, and removing a field from the Geoprocessing framework is a lot slower than ArcObjects).

Thanks!

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
New Contributor III

As a workaround I build a function that wil convert a list of my own FieldMapping Classes to a correct formatted string for the Geo processing parameter.

The parameters from the geo processing history gave me a clue on how to format the field mappings to text myself.

A decent ESRI solution would be preferable though. Because building the text on your own leaves room for errors, and you need to know the fields of both feature classes.

View solution in original post

Reply
0 Kudos
1 Reply
Highlighted
New Contributor III

As a workaround I build a function that wil convert a list of my own FieldMapping Classes to a correct formatted string for the Geo processing parameter.

The parameters from the geo processing history gave me a clue on how to format the field mappings to text myself.

A decent ESRI solution would be preferable though. Because building the text on your own leaves room for errors, and you need to know the fields of both feature classes.

View solution in original post

Reply
0 Kudos