Using C# and ArcObjects, what is the recommended way to convert a raster file into a polygon. I need this for calling the Near tool so that I can move a station which may be inland to the nearest water feature. I have googled and really not found anything useful yet. There is a lot for taking a polygon to a Raster but not the other way around.
If you want to avoid geoprocessing (which is typically slow), have a look at IConversionOp interface:
Haven't used it myself but it seems to offer what you're looking for.
Your best option is calling the Raster to Polygon (Conversion) geoprocessing tool. Note that your raster must be of the integer type.
If you want to convert your entire raster to a polygon you can use the Int (Spatial Analyst) geoprocessing tool.
You can use the Con (Spatial Analyst) geoprocessing tool to select parts of your input raster and produce an integer raster at the same time. This is useful, for example, if you want to create a polygon representing areas within the raster that have values greater than an input value (e.g. all elevations above 500m).