Original User: luke.kaim

I need some help with this code. I need to be able to change the units of X and Y within model builder. Therefore, I can not use calculate geometry. How do I convert the X and Y locations into decimal degrees using the field calculator? The below code is not working. I want to find X and Y location of points and then be able to change the units of the points from meters to decimal degrees. I need to be able to automate this process. Please help.

X-coordinate of a point

Dim dblX As Double

Dim pPoint As IPoint

Set pPoint = [Shape]

dblX = pPoint.X

Y-coordinate of a point

Dim dblY As Double

Dim pPoint As IPoint

Set pPoint = [Shape]

dblY = pPoint.Y

"Shape and length properties of the geometry field can be modified with unit types expressed with an @ sign".

Thank you,

Luke Kaim

Thank you

Luke Kaim (SIE)

Lucas.Kaim@maine.edu

(914)263-7866

I need some help with this code. I need to be able to change the units of X and Y within model builder. Therefore, I can not use calculate geometry. How do I convert the X and Y locations into decimal degrees using the field calculator? The below code is not working. I want to find X and Y location of points and then be able to change the units of the points from meters to decimal degrees. I need to be able to automate this process. Please help.

X-coordinate of a point

Dim dblX As Double

Dim pPoint As IPoint

Set pPoint = [Shape]

dblX = pPoint.X

Y-coordinate of a point

Dim dblY As Double

Dim pPoint As IPoint

Set pPoint = [Shape]

dblY = pPoint.Y

"Shape and length properties of the geometry field can be modified with unit types expressed with an @ sign".

Thank you,

Luke Kaim

Thank you

Luke Kaim (SIE)

Lucas.Kaim@maine.edu

(914)263-7866

"I know the 3D team calculates a conversion value when horizontal coordsys is geographic to match up with the z values. It helps that data is usually large scale, so you can make an assumption. A rough equivalency is that 1 deg north-south is about 110 km. However, this only holds east-west at the equator. A rough estimate for east-west is 110 km * cos(latitude). Thus, at 60N or 60S, a degree is around 55 km. How the 3D team balances that out, I don't know."

Latitude is the Y coordinate. You should not use the VBA method of extracting point data anymore, because at ArcGIS 10 it does not work in the field calculator, only Python will work. So for Python using Melita's formula your Y coordinate would be:

110 * cos(!shape.Y!) * #unit_conversion_factor#

Replace the #unit_conversion_factor# above to be the unit conversion factor that will convert from km to the linear units that you ultimately want. For example, km to meters is 1000, and km to feet is approximately 3280.838862.

Edit: (This is backwards from what you want to do. Sorry.)