Hello everyone
I have a question concerning Python in ArcMap (field calculator):
I want to write following code with python, in attributes table; field calculator. But I can't.
Could you help me,
Thanks.
Dim pSpRef1 As ISpatialReference
Dim pSpRFc As SpatialReferenceEnvironment
Set pSpRFc = New SpatialReferenceEnvironment
Dim pGCS As IGeographicCoordinateSystem
Set pGCS =
pSpRFc.CreateGeographicCoordinateSystem(esriSRGeoCS_NAD1983)
Set pSpRef1 = pGCS
pSpRef1.SetFalseOriginAndUnits -180, -90, 1000000
Dim pPCS As IProjectedCoordinateSystem
Dim pSpRef2 As ISpatialReference
Set pPCS =
pSpRFc.CreateProjectedCoordinateSystem(esriSRProjCS_NAD1983USA_
Albers)
pPCS.SetFalseOriginAndUnits 0, 0, 1000
Set pSpRef2 = pPCS
Dim dblArea As double
Dim CenterX As double
Dim CenterY As double
Dim pArea As IArea
Set pArea = [shape]
Dim pGeo As IGeometry
Set pGeo = pArea
Set pGeo.SpatialReference = pSpRef1
pGeo.Project pSpRef2
Set pArea = pGeo
dblArea = pArea.Area
theKm = dblArea / 1000000