0
A
回答
2
我在几年前制作了这个Java代码,它将ISN93
转换为GPS使用的系统:WGS84
。
https://github.com/Kjarni/StraetoRouteAPI/blob/master/java/ISN93_to_WGS84.java
package org.kjarni;
import android.graphics.PointF;
/*
* Copyright (c) 2012, Gunnar Gu�var�arson, Gabr�el A. P�tursson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* // example conversion:
* PointF point = new PointF(359583, 406481);
* ISN93_to_WGS84 converter = new ISN93_to_WGS84();
* PointF result = converter.ISN93_WGS84(point);
* label1.setText("x: " + result.x + " y: " + result.y);
*/
public class ISN93_to_WGS84
{
private double a = 6378137.0;
private double f = 1.0/298.257222101;
private double lat1 = 64.25;
private double lat2 = 65.75;
private double latc = 65.00;
private double lonc = 19.00;
private double eps = 0.00000000001;
private double lat = 0;
private double delta = 1.0;
private double rho, e, dum, sint, f2sin1, pol1, polc, peq;
public ISN93_to_WGS84()
{
rho = 45.0/Math.atan2(1.0, 1.0);
e = Math.sqrt(f * (2 - f));
dum = f2(Math.sin(lat1/rho)) - f2(Math.sin(lat2/rho));
sint = 2 * (Math.log(fx(lat1)) - Math.log(fx(lat2)))/dum;
f2sin1 = f2(Math.sin(lat1/rho));
pol1 = fx(lat1)/sint;
polc = f3(latc) + 500000.0;
peq = a * Math.cos(latc/rho)/(sint * Math.exp(sint * Math.log((45 - latc/2)/rho)));
}
private double fx (double p)
{
return a * Math.cos(p/rho)/Math.sqrt(1 - Math.pow(e * Math.sin(p/rho), 2));
}
private double f1 (double p)
{
return Math.log((1 - p)/(1 + p));
}
private double f2 (double p)
{
return f1(p) - e * f1(e * p);
}
private double f3 (double p)
{
return pol1 * Math.exp((f2(Math.sin(p/rho)) - f2sin1) * sint/2);
}
public PointF ISN93_WGS84(PointF input)
{
double pol = Math.sqrt(Math.pow(input.x - 500000, 2) + Math.pow(polc - input.y, 2));
double lon = 90 - 2 * rho * Math.atan(Math.exp(Math.log(pol/peq)/sint));
double fact = rho * Math.cos(lon/rho)/sint/pol;
while (Math.abs(delta) > eps)
{
delta = (f3(lon) - pol) * fact;
lon += delta;
}
lat = -(lonc + rho * Math.atan((500000 - input.x)/(polc - input.y))/sint);
return new PointF((float)lat, (float)lon);
}
}
1
下面是一些JavaScript代码转换WGS84到ISN93:
https://gist.github.com/kristjanmik/6925cbefaa311145c58a
function WGS84_To_ISN93(l,m){
l = parseFloat(l);
m = parseFloat(m);
var k=l*0.0174532925199433;
var p=0.0818191913305*Math.sin(k);
var o=11616778.382033*Math.pow(Math.tan(
0.785398163397448-(k/2))/Math.pow(
(1-p)/(1+p),0.04090959566525),0.90633380084752);
var q=(m+19)*0.0158185089469038;
return {
x:Math.round((500000+o*Math.sin(q))*1000)/1000,
y:Math.round((3482044.27322585-o*Math.cos(q))*1000)/1000
};
}
确保您使用它之前做的测试,电池完全解决这个问题。我没有对此进行全面分析,以确保在所有情况下都完全正确。如果您发现任何问题,请告知我。
相关问题
- 1. 将纬度经度坐标转换为图像地图坐标
- 2. 将坐标从长岛区转换为经纬度。长格式与R
- 3. 转换物理地址为长纬度坐标
- 4. PHP转义经纬度和长坐标。
- 5. 将坐标转换为像素坐标
- 6. 纬度长到XY坐标
- 7. 将十进制经度/纬度坐标转换为iPad屏幕坐标
- 8. 将坐标分为纬线和纬度
- 9. 如何将UTM坐标转换为纬度和经度R
- 10. 将GPS坐标转换为经纬度格式?
- 11. 如何将TM-2度坐标转换为Android上的纬度?
- 12. 将瓦片的xyz坐标转换为经度/纬度
- 13. 如何将极坐标系转换为经纬度
- 14. 将游戏的x,y坐标转换为Google Earth经纬度
- 15. 将UTM坐标转换为经纬度的开源PHP函数?
- 16. 将经纬度转换为opengl中的世界坐标右手
- 17. 将x,y,区域坐标转换为经度和纬度
- 18. MonoDroid将位置纬度经度Double转换为坐标
- 19. 将经纬度转换为X/Y坐标
- 20. 将经度和纬度转换为ECEF坐标系统
- 21. 将经度/纬度转换为X/Y坐标
- 22. 将南/东GPS坐标转换为纬度/经度
- 23. 将东北坐标转换为正常的经度和纬度
- 24. 将笛卡尔坐标转换为经度/纬度
- 25. 如何将EPSG坐标转换为经度/纬度?
- 26. 试图将经度/纬度转换为笛卡尔坐标
- 27. Rails的Geokit转换GPS坐标,以谷歌纬度长
- 28. 转换长和纬度坐标来在全国仅
- 29. 使用4个已知GCP点将纬度长坐标转换为像素坐标的代码
- 30. 转换像素经纬度坐标
您是否需要在.NET应用程序中转换这些数据,或者您是否需要转换一堆GPS数据?这很容易取决于你有什么工具。例如,如果您在PostGIS数据库中有GPS数据(假设为WGS84数据),则可以简单地运行一条语句,如“SELECT ST_Transform(geometry_column_name,4659)'。如果您有像ArcGIS这样的工具,那么您可以使用内置的重投影功能。 – sovemp 2013-04-08 16:46:12