Coordinate System Transformation to NAD83 using C#/.NET

643
1
07-31-2013 12:15 PM
KeyurPatel
New Contributor
I am currently working on a ASP.NET web application that allows users to upload shapefiles to store data in the database. For everything to work smoothly, I need the coordinate system to be NAD83, is it possible for me to convert whatever coordinate system is being uploaded to NAD83 format? I am ArcObjects SDK for .NET installed, but my knowledge about GIS is very minimal (first time working on a GIS-based application). I have the following files: shp, dbf, prj, shx and sbn for each feature. If anyone has ideas on how to go about doing something like this, I would greatly appreciate the help.
0 Kudos
1 Reply
DavidClarke1
New Contributor III
Yes you can convert the coordinates between different systems.  You must know the coordinate system of the source data though.
If you know the spatial reference of the source just plug it in below along with the source x/y coordinates (via "PutCoords").  Once you execute the "Project" method with the desired spatial reference, you can query the X, Y (via "QueryCoords") to get the new coordinates.

Dim NewPoint As ESRI.ArcGIS.Geometry.IPoint = New ESRI.ArcGIS.Geometry.PointClass
NewPoint.SpatialReference = _sourceSpatialReference
NewPoint.PutCoords(SourceX, SourceY)

NewPoint.Project(_desiredSpatialReference)
NewPoint.QueryCoords(X, Y)
0 Kudos