AnsweredAssumed Answered

Calculate Geometry via ArcObjects - Using Data Frame Projection

Question asked by deleted-user-VeC5jUIlNXtq on Dec 3, 2013
Latest reply on Dec 3, 2013 by deleted-user-VeC5jUIlNXtq
Hey all,

I'm modifying an existing program we use which originally took input from a .dxf layer (which had a spatial reference of a UTM Zone). Now, I'm asking the user for a .GPX file, then use code to geoprocess (GPX To Feature), and then from there do some other functions that are not really relevant, except for one: calculating geometry.

My goal is to populate fields for easting and northing, using the data frame coordinate system (see further below).

The points I'll be getting (from my above processing) will be a feature class in a geodatabase in Geographic WGS84 (the default spatial reference of the GPX to Feature tool). I believe using IPoint.X and IPoint.Y will return values based on the layer (correct me if I'm wrong) which would result in incorrect data for what I'm after.

So, essentially I want to select a field, let's call them "UTM_E" and "UTM_N" and basically: perform a right-click -> Calculate Geometry, using meters as the unit, and the data frame as opposed to the layer, and the appropriate X or Y coordinate drop-down choice.

Seems simple enough to me, but I really don't know where to look.

I think what I'm going to do is tell the user to pick UTM Zone 11 or 12 as the data frame projection at the start of the program (the user will know for sure where the points are), and then go from there.

Anyways, I feel like a push in the right direction will suffice, so any suggestions are most welcome, and if it's not possible, what would be a useful alternative?

Thanks very much!

Outcomes