UTM Projected Coordinate System - set units to feet in ArcObjects

843
2
08-08-2013 08:33 AM
PaulDavidson1
Occasional Contributor III
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)
' somewhere in here I want to set the SR to be using units of feet

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.
The code is probably overly complicated but it is what it is for now.
Thanks

Is this the appropriate forum for this post ?
0 Kudos
2 Replies
PaulDavidson1
Occasional Contributor III
0 Kudos
hparis
by
New Contributor

This link doesn't work.

0 Kudos