?? opengvs_geo.h
字號(hào):
/************************************************************
** Copyright 1999 BUAA VRLAB **
** All rights reserved. **
** Coordinate Transformation **
************************************************************/
/************************************************************/
/* Kingsong 2002.12 */
/************************************************************/
/* Transverse Mercator prototypes*/
#ifndef _UTM_GEO_H
#define _UTM_GEO_H
/* Snyder, "Map Projections -- a Working Manual" USGS Professional Paper 1395, p47.
Conformal.
Cylindrical (transverse).
Central meridian, each meridian 90 degrees from central meridian,
and Equator are straight lines.
Other meridians and parallels are complex curves.
Scale is true along central meridian, or along two straight lines
equidistant from and parallel to central meridian. These lines are only
approximately straight for the ellipsoid.
Scale becomes infinite on sphere 90 degrees from central meridian.
Used extensively for quadrangle maps at scales from 1:24,000 to 1:250,000.
Presented by Lambert in 1772.
*/
#ifdef __cplusplus
extern "C"{
#endif
typedef struct MapDatum
{
// sphere datum
double a, rf;
// offset datum
double x;
double y;
// zone
long zone;
}MapDatum;
//MapDatum MD;
extern short init_MapDatum
(double origin_lat, double origin_lon,
double a = 6378137.0, double rf = 298.257223563);
/* Set the computation buffer */
extern short init_transverse_mercator
( void* cnstsP, const char* opt_name, double a, double rf,
double phi0, double lam0, double k0 );
extern const void* set_transverse_mercator
( const char* opt_name, double a, double rf, double phi0, double lam0, double k0 );
/* a, rf: semi-major axis (meters) and reciprocal flattening.
Spherical only - if rf != 0.0, the mean radius is used.
phi0,lam0: geographic origin of the projection (radians).
k0: Scale factor at origin.
return: pointer to the constant array. NULL => error.
*/
/* Geographic to projection (&scale) */
extern int geo_to_transverse_mercator
( const void* cnsts, double phi, double lam, double* x, double* y );
/* cnsts: pointer to constants created by set_transverse_mercator..
phi, lam: latitude & longitude of the input point (radians).
x,y: computed easting and northing (including fn & fe ) (meters)
*/
/* Metric to Geographic */
extern int transverse_mercator_to_geo
( const void* cnsts, double x, double y, double* phi, double* lam );
/* cnsts: pointer to constants created by set_transverse_mercator..
x,y: easting and northing (including fn & fe ) (meters).
phi, lam: computed latitude & longitude (radians).
*/
/* scale factors */
extern int transverse_mercator_scale
( const void* cnsts, double phi, double lam, double* h, double* k );
extern int transverse_mercator_limits
( const void* cnsts, double* mnp, double* mnl, double* mxp, double* mxl );
/* UTM - zones require special handling */
extern short init_utm( void* cnstsP, double a, double rf );
extern const void* set_utm( double a, double rf );
extern short utm_to_geo
( const void* tcnsts,
long zone, double easting,double northing,
double* lat, double* lon
);
extern short geo_to_utm
( const void* tcnsts,
double lat, double lon,
long* izone, double* easting,double* northing );
//
extern short opengvs_to_geo
( double x,double y, double z,
double* lat, double* lon,double* alt);
extern short geo_to_opengvs
( double* x,double* y, double* z,
double lat, double lon,double alt);
//
extern short utm_to_opengvs
( double* x,double* y, double* z,
double X, double Y);
/*extern short opengvs_to_utm
( double x,double y, double z,
double *X, double* lon,double* alt);*/
//
extern short utm_scale
( const void* tcnsts,
double lat, double lon,
double* h, double* k
);
extern int utm_limits
( const void* cnsts, double* mnp, double* mnl, double* mxp, double* mxl );
#ifdef __cplusplus
}
#endif
#endif /* _UTM_GEO_H */
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -