这些天在整北京54到WGS84的坐标转换的问题,需要批量的把北京54的坐标转为wgs84的坐标,试验了多种方法均为凑效,终于在最后让我实验成功了一种方法。先贴源码。
private IPoint PRJtoGCS(double x, double y)
{
IPoint pPoint = new PointClass();
pPoint.PutCoords(x, y);
ISpatialReferenceFactory pSRF = new SpatialReferenceEnvironmentClass();
pPoint.SpatialReference = pSRF.CreateProjectedCoordinateSystem(2428);
pPoint.Project(pSRF.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_Beijing1954));
return pPoint;
}
private IPoint GCStoPRJ(IPoint pPoint, int GCSType,int PRJType)
{
ISpatialReferenceFactory pSRF = new SpatialReferenceEnvironmentClass();
pPoint.SpatialReference = pSRF.CreateGeographicCoordinateSystem(GCSType);
pPoint.Project(pSRF.CreateProjectedCoordinateSystem(PRJType));
return pPoint;
}
主要用到这两个函数,第一个函数是把北京54坐标转为WGS84的坐标,选的条带为2428号,这个条带号请根据自己的实际情况,在下面选择。程序基于ArcGIS Engine,只要循环执行那个函数就行了,其他不多说了,希望看到的您能用的到。
//球面坐标
//esriSRGeoCS_WGS1984 4326 WGS 1984.
//esriSRGeoCS_Beijing1954 4214 Beijing 1954.
// 平面坐标
////北京54六度带
//esriSRProjCS_Beijing1954GK_13 21413 Beijing 1954 GK Zone 13.
//esriSRProjCS_Beijing1954GK_14 21414 Beijing 1954 GK Zone 14.
//esriSRProjCS_Beijing1954GK_15 21415 Beijing 1954 GK Zone 15.
//esriSRProjCS_Beijing1954GK_16 21416 Beijing 1954 GK Zone 16.
//esriSRProjCS_Beijing1954GK_17 21417 Beijing 1954 GK Zone 17.
//esriSRProjCS_Beijing1954GK_18 21418 Beijing 1954 GK Zone 18.
//esriSRProjCS_Beijing1954GK_19 21419 Beijing 1954 GK Zone 19.
//esriSRProjCS_Beijing1954GK_20 21420 Beijing 1954 GK Zone 20.
//esriSRProjCS_Beijing1954GK_21 21421 Beijing 1954 GK Zone 21.
//esriSRProjCS_Beijing1954GK_22 21422 Beijing 1954 GK Zone 22.
//esriSRProjCS_Beijing1954GK_23 21423 Beijing 1954 GK Zone 23.
//esriSRProjCS_Beijing1954GK_13N 21473 Beijing 1954 GK Zone 13N.
//esriSRProjCS_Beijing1954GK_14N 21474 Beijing 1954 GK Zone 14N.
//esriSRProjCS_Beijing1954GK_15N 21475 Beijing 1954 GK Zone 15N.
//esriSRProjCS_Beijing1954GK_16N 21476 Beijing 1954 GK Zone 16N.
//esriSRProjCS_Beijing1954GK_17N 21477 Beijing 1954 GK Zone 17N.
//esriSRProjCS_Beijing1954GK_18N 21478 Beijing 1954 GK Zone 18N.
//esriSRProjCS_Beijing1954GK_19N 21479 Beijing 1954 GK Zone 19N.
//esriSRProjCS_Beijing1954GK_20N 21480 Beijing 1954 GK Zone 20N.
//esriSRProjCS_Beijing1954GK_21N 21481 Beijing 1954 GK Zone 21N.
//esriSRProjCS_Beijing1954GK_22N 21482 Beijing 1954 GK Zone 22N.
//esriSRProjCS_Beijing1954GK_23N 21483 Beijing 1954 GK Zone 23N.
////北京54三度带
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_102E 2431 Beijing 1954 3 Degree GK CM 102E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_105E 2432 Beijing 1954 3 Degree GK CM 105E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_108E 2433 Beijing 1954 3 Degree GK CM 108E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_111E 2434 Beijing 1954 3 Degree GK CM 111E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_114E 2435 Beijing 1954 3 Degree GK CM 114E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_117E 2436 Beijing 1954 3 Degree GK CM 117E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_120E 2437 Beijing 1954 3 Degree GK CM 120E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_123E 2438 Beijing 1954 3 Degree GK CM 123E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_126E 2439 Beijing 1954 3 Degree GK CM 126E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_129E 2440 Beijing 1954 3 Degree GK CM 129E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_132E 2441 Beijing 1954 3 Degree GK CM 132E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_135E 2442 Beijing 1954 3 Degree GK CM 135E.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_25 2401 Beijing 1954 3 Degree GK Zone 25.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_26 2402 Beijing 1954 3 Degree GK Zone 26.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_27 2403 Beijing 1954 3 Degree GK Zone 27.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_28 2404 Beijing 1954 3 Degree GK Zone 28.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_29 2405 Beijing 1954 3 Degree GK Zone 29.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_30 2406 Beijing 1954 3 Degree GK Zone 30.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_31 2407 Beijing 1954 3 Degree GK Zone 31.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_32 2408 Beijing 1954 3 Degree GK Zone 32.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_33 2409 Beijing 1954 3 Degree GK Zone 33.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_34 2410 Beijing 1954 3 Degree GK Zone 34.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_35 2411 Beijing 1954 3 Degree GK Zone 35.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_36 2412 Beijing 1954 3 Degree GK Zone 36.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_37 2413 Beijing 1954 3 Degree GK Zone 37.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_38 2414 Beijing 1954 3 Degree GK Zone 38.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_39 2415 Beijing 1954 3 Degree GK Zone 39.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_40 2416 Beijing 1954 3 Degree GK Zone 40.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_41 2417 Beijing 1954 3 Degree GK Zone 41.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_42 2418 Beijing 1954 3 Degree GK Zone 42.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_43 2419 Beijing 1954 3 Degree GK Zone 43.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_44 2420 Beijing 1954 3 Degree GK Zone 44.
//esriSRProjCS_Beijing1954_3_Degree_GK_Zone_45 2421 Beijing 1954 3 Degree GK Zone 45.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_75E 2422 Beijing 1954 3 Degree GK CM 75E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_78E 2423 Beijing 1954 3 Degree GK CM 78E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_81E 2424 Beijing 1954 3 Degree GK CM 81E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_84E 2425 Beijing 1954 3 Degree GK CM 84E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_87E 2426 Beijing 1954 3 Degree GK CM 87E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_90E 2427 Beijing 1954 3 Degree GK CM 90E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_93E 2428 Beijing 1954 3 Degree GK CM 93E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_96E 2429 Beijing 1954 3 Degree GK CM 96E.
//esriSRProjCS_Beijing1954_3_Degree_GK_CM_99E 2430 Beijing 1954 3 Degree GK CM 99E.
////西安80坐标
//esriSRProjCS_Xian1980_3_Degree_GK_CM_102E 2379 Xian 1980 3 Degree GK CM 102E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_105E 2380 Xian 1980 3 Degree GK CM 105E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_108E 2381 Xian 1980 3 Degree GK CM 108E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_102E 2379 Xian 1980 3 Degree GK CM 102E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_105E 2380 Xian 1980 3 Degree GK CM 105E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_108E 2381 Xian 1980 3 Degree GK CM 108E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_111E 2382 Xian 1980 3 Degree GK CM 111E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_114E 2383 Xian 1980 3 Degree GK CM 114E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_117E 2384 Xian 1980 3 Degree GK CM 117E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_120E 2385 Xian 1980 3 Degree GK CM 120E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_123E 2386 Xian 1980 3 Degree GK CM 123E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_126E 2387 Xian 1980 3 Degree GK CM 126E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_129E 2388 Xian 1980 3 Degree GK CM 129E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_132E 2389 Xian 1980 3 Degree GK CM 132E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_135E 2390 Xian 1980 3 Degree GK CM 135E.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_25 2349 Xian 1980 3 Degree GK Zone 25.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_26 2350 Xian 1980 3 Degree GK Zone 26.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_27 2351 Xian 1980 3 Degree GK Zone 27.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_28 2352 Xian 1980 3 Degree GK Zone 28.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_29 2353 Xian 1980 3 Degree GK Zone 29.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_30 2354 Xian 1980 3 Degree GK Zone 30.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_31 2355 Xian 1980 3 Degree GK Zone 31.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_32 2356 Xian 1980 3 Degree GK Zone 32.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_33 2357 Xian 1980 3 Degree GK Zone 33.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_34 2358 Xian 1980 3 Degree GK Zone 34.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_35 2359 Xian 1980 3 Degree GK Zone 35.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_36 2360 Xian 1980 3 Degree GK Zone 36.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_37 2361 Xian 1980 3 Degree GK Zone 37.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_38 2362 Xian 1980 3 Degree GK Zone 38.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_39 2363 Xian 1980 3 Degree GK Zone 39.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_40 2364 Xian 1980 3 Degree GK Zone 40.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_41 2365 Xian 1980 3 Degree GK Zone 41.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_42 2366 Xian 1980 3 Degree GK Zone 42.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_43 2367 Xian 1980 3 Degree GK Zone 43.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_44 2368 Xian 1980 3 Degree GK Zone 44.
//esriSRProjCS_Xian1980_3_Degree_GK_Zone_45 2369 Xian 1980 3 Degree GK Zone 45.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_75E 2370 Xian 1980 3 Degree GK CM 75E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_78E 2371 Xian 1980 3 Degree GK CM 78E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_81E 2372 Xian 1980 3 Degree GK CM 81E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_84E 2373 Xian 1980 3 Degree GK CM 84E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_87E 2374 Xian 1980 3 Degree GK CM 87E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_90E 2375 Xian 1980 3 Degree GK CM 90E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_93E 2376 Xian 1980 3 Degree GK CM 93E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_96E 2377 Xian 1980 3 Degree GK CM 96E.
//esriSRProjCS_Xian1980_3_Degree_GK_CM_99E 2378 Xian 1980 3 Degree GK CM 99E.
//esriSRProjCS_Xian1980_GK_CM_105E 2343 Xian 1980 GK CM 105E.
//esriSRProjCS_Xian1980_GK_CM_111E 2344 Xian 1980 GK CM 111E.
//esriSRProjCS_Xian1980_GK_CM_117E 2345 Xian 1980 GK CM 117E.
//esriSRProjCS_Xian1980_GK_CM_123E 2346 Xian 1980 GK CM 123E.
//esriSRProjCS_Xian1980_GK_CM_129E 2347 Xian 1980 GK CM 129E.
//esriSRProjCS_Xian1980_GK_Zone_13 2327 Xian 1980 GK Zone 13.
//esriSRProjCS_Xian1980_GK_CM_135E 2348 Xian 1980 GK CM 135E.
//esriSRProjCS_Xian1980_GK_Zone_14 2328 Xian 1980 GK Zone 14.
//esriSRProjCS_Xian1980_GK_Zone_15 2329 Xian 1980 GK Zone 15.
//esriSRProjCS_Xian1980_GK_Zone_16 2330 Xian 1980 GK Zone 16.
//esriSRProjCS_Xian1980_GK_Zone_17 2331 Xian 1980 GK Zone 17.
//esriSRProjCS_Xian1980_GK_Zone_18 2332 Xian 1980 GK Zone 18.
//esriSRProjCS_Xian1980_GK_Zone_19 2333 Xian 1980 GK Zone 19.
//esriSRProjCS_Xian1980_GK_Zone_20 2334 Xian 1980 GK Zone 20.
//esriSRProjCS_Xian1980_GK_Zone_21 2335 Xian 1980 GK Zone 21.
//esriSRProjCS_Xian1980_GK_Zone_22 2336 Xian 1980 GK Zone 22.
//esriSRProjCS_Xian1980_GK_Zone_23 2337 Xian 1980 GK Zone 23.
//esriSRProjCS_Xian1980_GK_CM_75E 2338 Xian 1980 GK CM 75E.
//esriSRProjCS_Xian1980_GK_CM_81E 2339 Xian 1980 GK CM 81E.
//esriSRProjCS_Xian1980_GK_CM_87E 2340 Xian 1980 GK CM 87E.
//esriSRProjCS_Xian1980_GK_CM_93E 2341 Xian 1980 GK CM 93E.
//esriSRProjCS_Xian1980_GK_CM_99E 2342 Xian 1980 GK CM 99E.