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.

89 lines
2.6 KiB
C++

/////////////////////////////////////////////////////////////////////////////
//文件: Projection.cpp
//主要功能:
// 投影转换
//
//程序编写: 2008-11-09
//
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_PROJECTION_H__599FB19F_4D86_44E5_925E_D403A83DDAF5__INCLUDED_)
#define AFX_PROJECTION_H__599FB19F_4D86_44E5_925E_D403A83DDAF5__INCLUDED_
#include "Ellipsoid.h" // Added by ClassView
#include "ProjectionParameter.h" // Added by ClassView
#include "ConformalConic.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define _AREA_NORTH_LATITUDE 0 //北半球 北纬
#define _AREA_SOUTH_LATITUDE 1 //南半球 南纬
#define _AREA_EAST_LONGITUDE 0 //东经
#define _AREA_WEST_LONGITUDE 1 //西经
class AFX_EXT_CLASS CProjection
{
public:
CProjection();
virtual ~CProjection();
public:
CProjection& operator =(CProjection &p);
BOOL Initial(CString projection_file); //在初始化之前,必须先设置输入、输出参数
BOOL Initial(double m_a,double m_f); //长半轴、扁平率倒数
void CreateDefaultProjection(CString file); //生成缺省参数文件
BOOL SetInBasesOut(int coor=_XY_BL_BL, int unit=_XY_BL_DMS);//根据输入参数设置输出参数为经纬度
BOOL SetOutBasesIn(int coor=_XY_BL_BL, int unit=_XY_BL_DMS);//根据输出参数设置输入参数为经纬度
BOOL SetArgv(const CString ArgvIn, const CString ArgvOut);
BOOL SetOutArgv(const CString ArgvOut); //设置输出参数
BOOL SetInArgv(const CString ArgvIn); //设置输入参数
CString GetOutArgv();
CString GetInArgv();
int Exchange(CString m_input,CString m_output,char *mode="wt");
int Exchange(char *line);
int Exchange(double *xx, int num);
virtual void SetProgressPos(double dPos);
protected:
void ExchangeToOtherBL(CEllipsoid* pIn, CEllipsoid* pOut, double *xx);
void ExchangeToOtherXYZ(CEllipsoid* pEllipsoid, double *xx);
void ExchangeCustomBL(double *xx);
void ExchangeCustomXY(double *xx);
void ExchangeXY(double *xx);
void ExchangeBL(double *xx);
void Exchange(double *xx);
int Exchange(char *line, double *xx);
public:
void ExchangeOldToNew(double *xx);
void ExchangeToOther(double *xx);
void SetDecimalDigits(int n);
//转换对象
CProjectionLambert m_ConformalConic_in, m_ConformalConic_out;
CProjectionGaussKruger m_in, m_out;
//参数
CProjectionParameter xy_in, xy_out;
int m_latitude; //北纬、南纬
int m_longitude; //东经、西经
//东经\西经, 北纬/南纬
void SetEarch(int longitudeSel, int latitudeSel);
void GetEarch(int &longitudeSel, int &latitudeSel);
virtual void Serialize(CArchive& ar, short ver);
private:
int decimal_digits;
};
#endif // !defined(AFX_PROJECTION_H__599FB19F_4D86_44E5_925E_D403A83DDAF5__INCLUDED_)