You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
2.9 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// Ellipsoid.h: interface for the CProjectionGaussKruger class.
/////////////////////////////////////////////////////////////////////////////
//主要功能:
// 投影转换
//
//程序编写: 2008-11-09
//
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_ELLIPSOID_H__B996064A_B913_4EA7_8BEF_846B8208C897__INCLUDED_)
#define AFX_ELLIPSOID_H__B996064A_B913_4EA7_8BEF_846B8208C897__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ConversionParameter.h"
/* 投影参数文件例子
c:>type Projection.ini
[ellipsoid]
克拉索夫斯基椭球
1967年大地坐标系
1975年大地坐标系
1980年大地坐标系
WGS-84(GPS定位系统)
[WGS-84(GPS定位系统)]
a=6378137
1/f=298.257223563
date=1984
append=GPS定位系统
[1967年大地坐标系]
a=6378160
1/f=298.247167
date=1967
append=1971年国际第三个推荐值
[1975年大地坐标系]
a=6378140
1/f=298.257
date=1975
append=1975年国际第三个推荐值
[1980年大地坐标系]
a=6378137
1/f=298.257
date=1979
append=1979年国际第四个推荐值
[克拉索夫斯基椭球]
a=6378245
1/f=298.3
date=1942
append=中国、苏联、朝鲜等
应用例子CProjectionGaussKruger::Initial("Projection.ini","克拉索夫斯基椭球");
*/
//#define PI 3.14159265358979324
//#define RHO (180.0/PI)
class AFX_EXT_CLASS CEllipsoid
{
public:
CEllipsoid();
virtual ~CEllipsoid();
//当输入的椭球体与输出的椭球体不同时,进行初始化
//例子: Initial("Projection.ini","1967年大地坐标系","1980年大地坐标系");
int Initial(CString lpFileName, CString lpAppName, CString other);
//lpFileName为投影参数文件, lpAppName投影参数文件中的椭球名
int Initial(CString lpFileName,CString lpAppName);
int Initial(double m_a,double m_f);
CEllipsoid& operator =(CEllipsoid &es);
//L=经度B=纬度,(X,Y,Z)直角坐标
void toBLH(double &XX,double &YY,double &ZZ); //
void toXYZ(double &B,double &L,double &H); //大地坐标计算空间大地直角坐标
double GetB(double &XX,double &YY,double &ZZ);
double GetM(double B); //子午圈曲率半径
double GetN(double B); //卯酉圈曲率半径
double GetR(double B); //平均曲率半径
double GetRA(double B); //任意法截线曲率半径
public:
CConversionParameter cp;//不同椭球体之间的转换参数
double pre;
double A0,B0,C0,D0;
double e2; //第
double a; //长半轴
double f; //扁平率倒数 f=(a-b)/a f=1/f
protected:
int Initial();
double arc_length_of_meridian(double B); //子午线弧长
double arc_length_of_meridian_reverse(double s);
};
//***************************** 高斯克吕格(横轴墨卡托)投影 *******************
class AFX_EXT_CLASS CProjectionGaussKruger : public CEllipsoid
{
public:
CProjectionGaussKruger();
CProjectionGaussKruger(double m_a,double m_f); //m_a为地球椭球长半轴,m_f为扁平率
virtual ~CProjectionGaussKruger();
//高斯投影正反变换
int GaussBL(double &x,double &y); //单位为弧度
int GaussXY(double &B,double &L);
int GaussXY(double &B, double &L,double L0); //单位为度
};
#endif // !defined(AFX_ELLIPSOID_H__B996064A_B913_4EA7_8BEF_846B8208C897__INCLUDED_)