坐标转换问题,我创建获取的定位是经纬度坐标,我创建了xian1980的投影坐标,X坐标返回的是科学计数法。
PrjCoordSys prjCoordSys = new PrjCoordSys();
prjCoordSys.fromXML(" <sml:CoordinateReferenceSystem>\n" +
" <sml:Name>Xian_1980_GK_Zone_21</sml:Name>\n" +
" <sml:Type>2335</sml:Type>\n" +
" <sml:EPSGCode>2335</sml:EPSGCode>\n" +
" <sml:Units>METER</sml:Units>\n" +
" <sml:DistUnits>METER</sml:DistUnits>\n" +
" <sml:GeographicCoordinateSystem>\n" +
" <sml:Name>GCS_XiAn_1980</sml:Name>\n" +
" <sml:Type>37312</sml:Type>\n" +
" <sml:EPSGCode>4610</sml:EPSGCode>\n" +
" <sml:Units>DEGREE</sml:Units>\n" +
" <sml:DistUnits>METER</sml:DistUnits>\n" +
" <sml:HorizontalGeodeticDatum>\n" +
" <sml:Name>D_XiAn_1980</sml:Name>\n" +
" <sml:Type>39312</sml:Type>\n" +
" <sml:Spheroid>\n" +
" <sml:Name>International_1975</sml:Name>\n" +
" <sml:Type>40023</sml:Type>\n" +
" <sml:SemiMajorAxis>6378140</sml:SemiMajorAxis>\n" +
" <sml:InverseFlattening>298.257</sml:InverseFlattening>\n" +
" </sml:Spheroid>\n" +
" </sml:HorizontalGeodeticDatum>\n" +
" <sml:PrimeMeridian>\n" +
" <sml:Name>Greenwich</sml:Name>\n" +
" <sml:Type>8901</sml:Type>\n" +
" <sml:PrimeMeridian>0</sml:PrimeMeridian>\n" +
" </sml:PrimeMeridian>\n" +
" </sml:GeographicCoordinateSystem>\n" +
" <sml:MapProjection>\n" +
" <sml:Name>Gauss_Kruger</sml:Name>\n" +
" <sml:Type>43005</sml:Type>\n" +
" </sml:MapProjection>\n" +
" <sml:Parameters>\n" +
" <sml:FalseEasting>21500000</sml:FalseEasting>\n" +
" <sml:FalseNorthing>0</sml:FalseNorthing>\n" +
" <sml:CentralMeridian>123</sml:CentralMeridian>\n" +
" <sml:StandardParallel1>0</sml:StandardParallel1>\n" +
" <sml:StandardParallel2>0</sml:StandardParallel2>\n" +
" <sml:ScaleFactor>1</sml:ScaleFactor>\n" +
" <sml:CentralParallel>0</sml:CentralParallel>\n" +
" <sml:Azimuth>0</sml:Azimuth>\n" +
" <sml:FirstPointLongitude>0</sml:FirstPointLongitude>\n" +
" <sml:SecondPointLongitude>0</sml:SecondPointLongitude>\n" +
" <sml:RectifiedAngle>0</sml:RectifiedAngle>\n" +
" </sml:Parameters>\n" +
" </sml:CoordinateReferenceSystem>");
boolean aa = CoordSysTranslator.forward(point2ds,prjCoordSys);
if (aa){
Log.d("978111", "X:"+point2ds.getItem(0).getX()+" Y:"+point2ds.getItem(0).getY());
}else {
Log.d("978111", "失败");
}
Log打印出 D/978111: X:2.1535013534609377E7 Y:4625225.743950611
Y坐标是能对应上的 但是X坐标对应不上