This content has been marked as final. Show 4 replies
I dont have the code to do that, but I can suggest the solution I am doing if this helps.
When you deploy your Mobile Application, have 2 fields, one for Lat and Long make them text fields.
Once your field crew upload points to the Server, you can have someone at a computer using ArcMap, calculate Lat and Long in those fields, and then your field crew can download the data accordingly.
If you are interested in doing it this way, let me know and I can help you out some more.
I have done conversions using the free corpson code libraries. You will have to copy the libraries to each machine and either put in same folder path location or use a config the application reads to know the stored path of the corpson libaries.
here is some code snippet of setting it up. there are some other calls you need to set up first that I did not include. If you want the rest of the code snippet- just let me know. Believe the download of corpscon includes a user guide.
<DllImport("F:\ArcIMS\Corpscon6\corpscon_v6.dll", EntryPoint:="GetXOut", SetLastError:=True, _ CharSet:=CharSet.Unicode, ExactSpelling:=True, _ CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function getoutx() As Double ' Leave function empty - DllImport attribute forces calls ' to Corpsconconfig to be forwarded to MoveFileW in KERNEL32.DLL. End Function <DllImport("F:\ArcIMS\Corpscon6\corpscon_v6.dll", EntryPoint:="GetYOut", SetLastError:=True, _ CharSet:=CharSet.Unicode, ExactSpelling:=True, _ CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function getouty() As Double ' Leave function empty - DllImport attribute forces calls ' to Corpsconconfig to be forwarded to MoveFileW in KERNEL32.DLL. End Function
then you just need to call your methods to convert to and from whatever.
Another suggestion. If the x,y being collected is the same soordinate system (e.g. state plane) as what is in your map document, then you can do the following:
// Create a spatial reference object from mobile service SpatialReference spatialReference = mobileService.SpatialReference; // specify input X and Y coordinates double x = 6220900; double y = 2300141; // Transform coordinate from map's coordinate system to WGS84. Coordinate coordinate = spatialReference.ToWgs84(x, y);
much simpler than going through corpscon
You could also use the SpatialReferenceConverter from ESRI.ArcGIS.Mobile.SpatialReferences to convert between any two coordinate systems that ESRI support, e.g.
SpatialReferenceConverter src = new SpatialReferenceConverter( SpatialReference.CreateWgs84SpatialReference(), SpatialReference.Create(2264)); Coordinate xy = src.FromSpatialReference1ToSpatialReference2(new Coordinate(lng, lat));
To convert from WGS84 to NAD_1983_StatePlane_North_Carolina_FIPS_3200_Feet.