我有纬度和经度点(23.7019973789308,72.5465551902882) 像这样,我有很多观点,用户在我的应用程序中输入, 我只想在C#的43区用米转换它们。 我没有得到任何合适的代码,谁可以转换这些点。 我也通过这个链接,但没有得到解决方案。 http://www.igorexchange.com/node/927
我也试过这个代码......
static public IPoint FromLatLonToUTM(double lon, double lat, out double UTM_x, out double UTM_y)
{
ISpatialReferenceFactory2 pSpatRefFact;
IProjectedCoordinateSystem pToPCS;
IGeographicCoordinateSystem pFromGCS;
IGeometry pGeo ;
IPoint pPoint;
UTM_x = 0;
UTM_y = 0;
pPoint = new PointClass();
pPoint.PutCoords(lon, lat);
pSpatRefFact = new SpatialReferenceEnvironmentClass();
pFromGCS = pSpatRefFact.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_NAD1983);
pToPCS = pSpatRefFact.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_NAD1983UTM_17N);
pGeo = pPoint;
pGeo.SpatialReference = pFromGCS;
pGeo.Project (pToPCS);
pPoint = (IPoint) pGeo;
UTM_x = pPoint.X;
UTM_y = pPoint.Y;
Debug.Write(UTM_x);
Debug.WriteLine("");
Debug.Write(UTM_y);
Debug.WriteLine("");
return pPoint;
}
帮助我.............