BaseCommonLibrary/BaseTool/RasterToolBase.h

97 lines
2.0 KiB
C
Raw Permalink Normal View History

2025-05-27 16:32:49 +00:00
/**
* @file RasterProjectBase.h
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 24-6-4
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#ifndef LAMPCAE_RASTERTOOLBASE_H
#define LAMPCAE_RASTERTOOLBASE_H
#include "BaseConstVariable.h"
#include "gdal_priv.h"
#include <memory>
#include "LogInfoCls.h"
namespace RasterToolBase {
static bool GDALAllRegisterEnable = false;
enum ProjectStripDelta {
Strip_6, // 6度带
Strip_3
};
enum CoordinateSystemType { // 坐标系类型
GeoCoordinateSystem,
ProjectCoordinateSystem,
UNKNOW
};
struct PointRaster { // 影像坐标点
double x;
double y;
double z;
};
struct PointXYZ {
double x, y, z;
};
struct PointGeo {
double lon, lat, ati;
};
struct PointImage {
double pixel_x, pixel_y;
};
/// 根据经纬度获取
/// EPSG代码根据经纬度返回对应投影坐标系统其中如果在中华人民共和国境内默认使用
/// CGCS2000坐标系统(EPSG 4502 ~ 4512 6度带,EPSG 4534 ~ 4554 3度带)其余地方使用WGS坐标系统
/// 投影方法 高斯克吕格(国内), 高斯克吕格
/// \param long 经度
/// \param lat 纬度
/// \return 对应投影坐标系统的 EPSG编码,-1 表示计算错误
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat(double long, double lat,
ProjectStripDelta stripState = ProjectStripDelta::Strip_3);
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat_inStrip3(double lon, double lat);
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat_inStrip6(double lon, double lat);
QString BASECONSTVARIABLEAPI GetProjectionNameFromEPSG(long epsgCode);
long BASECONSTVARIABLEAPI GetEPSGFromRasterFile(QString filepath);
std::shared_ptr<PointRaster> BASECONSTVARIABLEAPI GetCenterPointInRaster(QString filepath);
CoordinateSystemType BASECONSTVARIABLEAPI getCoordinateSystemTypeByEPSGCode(long EPSGCODE);
};// namespace RasterProjectConvertor
// 遥感类常用数据
#endif // LAMPCAE_RASTERTOOLBASE_H