pk_davidson

Use ArcObjects to change units from meters to feet in UTM_Zone_13N

Discussion created by pk_davidson on Aug 8, 2013
Latest reply on Aug 8, 2013 by pk_davidson
I inhereted an ArcObject system in 9.3 that reads in a csv file of XY locations and converts it into our state plane coord system.
Recently the csv source went from NAD_27 to NAD_1983 w/ UTM_ZONE13N.

I am close to getting this to work but my problem (I think) is that the csv file has XY coordinates in feet (US I believe) and the standard UTM_ZONE_13N coord system is expressed in meters. Yes, this is odd but it is what it is.
I have verified that most of code is correct by using ArcGIS to convert my raw data back to meters, hacking the code to read that file, etc...

In ArcGIS I can modify the coord system to be in feet and project the points correctly but in the ArcObject code I cannot figure out anyway to do this. Is this via ScaleFactor ? Resolution ?

Here's what I think is the pertinent code:
Dim spatialReferenceFactory As ISpatialReferenceFactory = New SpatialReferenceEnvironmentClass()
Dim projectedCS As IProjectedCoordinateSystem = spatialReferenceFactory.CreateProjectedCoordinateSystem(CInt(Fix(esriSRProjCSType.esriSRProjCS_NAD1983UTM_13N)))

Dim tempSR As ISpatialReference = TryCast(projectedCS, ISpatialReference)
tempSR.SetDomain(-16800800, 2955095154692.94, -32802000, 2955095154692.94)
tempSR.SetMDomain(-100000, 2955095154692.94)
tempSR.SetZDomain(-100000, 2955095154692.94)

Dim spatialRefResolution As ISpatialReferenceResolution = TryCast(tempSR, ISpatialReferenceResolution)
spatialRefResolution.XYResolution(False) = 0.000328083333333
Dim spatialRefTolerance As ISpatialReferenceTolerance = TryCast(spatialRefResolution, ISpatialReferenceTolerance)
spatialRefTolerance.XYTolerance = 0.000328083333333

toFeatureWorkspace.CreateFeatureDataset(datasetFullName, tempSR)

Is there a way to set the projectedCS to be in Foot_US ?

I also don't see why tempSR is being used as opposed to projectedCS.SetDomain, etc...
Looks like all tempSR does is take up extra memory. Maybe I'm missing something.

This is my first venture in ArcObjects so it's a lot to take in.
I think the code is probably very complicated but it is what it is for now.
Thanks

And is this the appropriate forum for this post or should this be in a coding forum ?  Which one, ArcObjects SDK?

Outcomes