Select to view content in your preferred language

Where is Smooth geometry in the SDK?

78
4
Thursday
DominicRorke2
Emerging Contributor

Hi, I'm wanting to call the 'Smooth' function via the API, but can not find it anywhere.

By 'Smooth', I'm refering to the functionality that in ArcObjects used to be IPolyCurve.Smooth, or in ArcPro GUI can be run by selecting 'Generalize' and then selecting the 'Smooth' radio button.  It smooths selected fetures by applying bezier curves.

I see there is a 'Smooth' Geoprocessing function, but that is of no use.  This needs to be applied as part of an edit operation.

Greatly appreciate if someone can point me in the right direction!

Thank you.

0 Kudos
4 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

I can suggest you to use geoprocessing tool SmoothLine. It is not simple way but it will work. Select polyline in layer and call geoprocessing tool. Then open output feature class and search for first element.

0 Kudos
DominicRorke2
Emerging Contributor

Hi @GKmieliauskas, thanks for taking the time to reply.  I'm looking for a code solution (hence posting in this Pro SDK forum).  I'm looking for a method in the Pro API that will smooth input geometries using Bezier curves.

For example, EditOperation class contains many methods for editing https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9482.html (such as Clip, Explode, Modify, Reshape etc), so I expected to maybe find smooth here maybe?  But no.

The other likely namespace would be ArcGIS.Core.Geometry, but I can't see Smooth there either.  It includes the GeometryEngine Class which has methods to Densify, Generalize (same as Simplify in the ArcPro GUI), and many others, but still there is no smooth.

0 Kudos
GKmieliauskas
Esri Regular Contributor

Hi,

Why don't you want to call geoprocessing tool from code? There is no help on calling specific tool from ArcGIS Pro API, but there are many samples:

arcgis-pro-sdk-community-samples/Geoprocessing at master · Esri/arcgis-pro-sdk-community-samples · G...

P.s There is Generalize method on GeometryEngine, but I don't know if it fits for your workflow.

0 Kudos
DominicRorke2
Emerging Contributor

Hi,

As you point out, geoprocessing tools output a new Feature Class.  This is of no use to me as I need to edit a feature directly within an edit session.

The Generalize method on GeometryEngine is not 'Smooth'.  What Smooth did in ArcMap, and does in ArcPro (Edit Tools > Generalization > 'Smooth' radio button), is turn a jaggedly drawn feature into a beautifully smooth feature by applying bezier curves to each segment.  This is what I'm after.

Cheers

0 Kudos