日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

西安80地理坐标转wgs84坐标(两种方法)

發布時間:2023/12/31 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 西安80地理坐标转wgs84坐标(两种方法) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

方法一:

用proj4j(proj4對應的java庫)towgs84參數對應的七個值為七參數值

public CoordinateTransform coordtrans() {CRSFactory targetFactory = new CRSFactory();CRSFactory crsFactory = new CRSFactory();//目標坐標系統String target_param = "+proj=longlat +datum=WGS84 +no_defs ";CoordinateReferenceSystem target = targetFactory.createFromParameters("wgs84", target_param);//源坐標系統String xian80_param = "+proj=longlat +a=6378140 +b=6356755.288157528 +towgs84=115.8,-154.4,-82.3,0,0,0,8 +no_defs ";CoordinateReferenceSystem xian80 = crsFactory.createFromParameters("xian80", xian80_param);CoordinateTransformFactory ctf = new CoordinateTransformFactory();CoordinateTransform transform = ctf.createTransform(xian80, target);return transform;} public static void main(String[] args) {SpringApplication.run(Demo1Application.class, args);Project_54 project_54=new Project_54();CoordinateTransform transforms=project_54.coordtrans();if (transforms != null) {ProjCoordinate projCoordinate = new ProjCoordinate(121.976469682,41.4470288037);transforms.transform(projCoordinate, projCoordinate);Double dNorth = projCoordinate.y;Double dEast = projCoordinate.x;System.out.print(dNorth);System.out.print("/");System.out.print(dEast);}}

方法二:

用arcgis js api? ?steps.wkt參見https://developers.arcgis.com/java/10-2/guide/datum-transformations.htm#ESRI_SECTION1_7635FE2A60E6449898D5AD0ADE2CA0C,可以對wkt的七參數進行自定義調整。

var steps= new GeographicTransformationStep() ;steps.wkt="GEOGTRAN[\"Xian_1980_To_WGS_1984\","+"GEOGCS[\"GCS_Xian_1980\",DATUM[\"D_Xian_1980\",SPHEROID[\"Xian_1980\",6378140.0,298.257]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],"+"GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],"+"METHOD[\"Position_Vector\"],PARAMETER[\"X_Axis_Translation\",115.8],PARAMETER[\"Y_Axis_Translation\",-154.4],PARAMETER[\"Z_Axis_Translation\",-82.3],PARAMETER[\"X_Axis_Rotation\",0.0],PARAMETER[\"Y_Axis_Rotation\",0.0],PARAMETER[\"Z_Axis_Rotation\",0.0],PARAMETER[\"Scale_Difference\",8]]";var geographicTransformation=new GeographicTransformation({steps:[steps]})var inSpatialReference = new SpatialReference({wkid: 4610 //Sphere_Sinusoidal});var outSpatialReference = new SpatialReference({wkid: 4326});var wgsPoints=new Point([121.976469682,41.4470288037],inSpatialReference);console.log(wgsPoints)projection.load().then(function(){var projectedPoints = projection.project(wgsPoints, outSpatialReference,geographicTransformation);console.log(projectedPoints.x)console.log(projectedPoints.y) })

總結:經證明,兩種方法得出的結果是一樣的

方法1結果:

方法二結果:

總結

以上是生活随笔為你收集整理的西安80地理坐标转wgs84坐标(两种方法)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。