googletran.h

来自「经纬行号转换, 有.CCP和.H文件各一个」· C头文件 代码 · 共 51 行

H
51
字号
#pragma once
#include <string>
using namespace std;
struct tag_DoubleRectangle
{
	double dMinX;
	double dMaxX;
	double dMinY;
	double dMaxY;
	double cx;
	double cy;
};
typedef struct tag_DoubleRectangle  CDoubleRectangle;

struct tag_GoogleRowCol
{
	int nRow;
	int nCol;
};

typedef struct tag_GoogleRowCol CGoogleRowCol;
class CGoogleTran  
{
public:
	CGoogleTran();
	virtual ~CGoogleTran();
public:	
	//经纬度转行列号
	CGoogleRowCol LatLon2RowCol(double dLon,double dLat,int nZoom);
	//经纬度转QRST URL
	string  LatLon2QRST(double dLon,double dLat,int nZoom);
	//得到QRST请求的影像块的坐标
	CDoubleRectangle GetCoordinatesFromQRSTAddress(string sQRST);
	//行列号转QRST
	string RowCol2QRST(int nRow,int nCol,int nZoom);
private:
	double MercatorToNormal(double y);
	string GetQuadtreeAddress(double dLon, double dLat,int nZoom);
	double NormalToMercator(double y);
	//经纬度转行列号---下面这两个函数不要直接,必须是影像块的左上角的坐标计算后才能得到正确的行列号
	int Longitude2Col(double dLon, int nZoom);
	int Latitude2Row(double dLat, int nZoom);
	//根据已知某个级别的行列号,得到比他低级别的行列号各级行列号
	int GetLevelNumber(int nRowCol,int nOrignZoom,int nZoom);
public:
	string GetSexagesimalNotation(double x);
	string GetGoogleURlPrex();
private:
	string m_sGoogleUrlPrex;//GoogleEarth的URL前缀
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?