It seems like there is no means of converting an ArcObjects geometry to the Well-Known Text representation (and vice versa) in ArcGIS ArcObjects API. The only thing I was able to find is conversion to WKB (the IWkb interface).

Is there a way to perform conversion between geometry objects and WKT or do I have to implement it myself? I primarily aim for .NET implementation without much external dependencies.

Your approach seems to work fine for me, but I'm wondering about my choice of srid here. I used this: int srid = feature.Shape.SpatialReference.FactoryCode; Do you agree with that implementation?
–
elrobisJul 9 '12 at 17:10

1

As long as you are using one of Esri's pre-defined coordinate systems this will work. The documentation notes the following "If you create a custom projected coordinate system, the factory code is zero."
–
SagebrushGISJul 30 '12 at 20:37

You might try referencing the Microsoft.SqlServer.Types assembly (which I believe is included with the free Sql Server Express edition), then use STGeomFromWKB static method to create a microsoft geometry, which could then be converted into WKT using STAsText.

Also note that while Microsoft catches a lot of flak about being proprietary, they do offer source code to a lot of useful functions in their SqlServer Spatial Tools at codeplex. So if the SqlServerTypes is too much external dependency for you you might be able to find source code that does this.

The DNRGPS open source project (licensing here) has extension methods for converting between IGeometry and WKT, although you'd have to adapt them to not use IObjectFactory if you want to use them outside an ArcGIS application.

The license looks pretty permissive so I put my standalone version (does not use IObjectFactory) of it up on GitHub if anyone was interested:

Update: I've made a few improvements to my version to support applying spatial references for the output geometry objects and using a integer coordinate friendly default spatial reference (Plate Carree) if none is specified.