📄 geotrans_base.cpp
字号:
{
Mercator_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Mercator_Coordinates(Interactive, Input, coord);
break;
}
case Miller_Cylindrical:
{
Miller_Cylindrical_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Miller_Cylindrical_Coordinates(Interactive, Input, coord);
break;
}
case Mollweide:
{
Mollweide_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Mollweide_Coordinates(Interactive, Input, coord);
break;
}
case Neys:
{
Neys_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Neys_Coordinates(Interactive, Input, coord);
break;
}
case NZMG:
{
NZMG_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_NZMG_Coordinates(Interactive, Input, coord);
break;
}
case Oblique_Mercator:
{
Oblique_Mercator_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Oblique_Mercator_Coordinates(Interactive, Input, coord);
break;
}
case Orthographic:
{
Orthographic_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Orthographic_Coordinates(Interactive, Input, coord);
break;
}
case Polar_Stereo:
{
Polar_Stereo_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Polar_Stereo_Coordinates(Interactive, Input, coord);
break;
}
case Polyconic:
{
Polyconic_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Polyconic_Coordinates(Interactive, Input, coord);
break;
}
case Sinusoidal:
{
Sinusoidal_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Sinusoidal_Coordinates(Interactive, Input, coord);
break;
}
case Stereographic:
{
Stereographic_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Stereographic_Coordinates(Interactive, Input, coord);
break;
}
case Transverse_Cylindrical_Equal_Area:
{
Transverse_Cylindrical_Equal_Area_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Transverse_Cylindrical_Equal_Area_Coordinates(Interactive, Input, coord);
break;
}
case Transverse_Mercator:
{
Transverse_Mercator_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Transverse_Mercator_Coordinates(Interactive, Input, coord);
break;
}
case UPS:
{
UPS_Tuple coord;
coord.hemisphere = flag_Hemisphere; // Hemisphere...
coord.easting = x;
coord.northing = y;
error_code = Set_UPS_Coordinates(Interactive, Input, coord);
break;
}
case UTM:
{
UTM_Tuple coord;
coord.hemisphere = flag_Hemisphere; // Hemisphere...
coord.zone = UTM_Zone; // UTM-Zone...
coord.easting = x;
coord.northing = y;
error_code = Set_UTM_Coordinates(Interactive, Input, coord);
break;
}
case Van_der_Grinten:
{
Van_der_Grinten_Tuple coord;
coord.easting = x;
coord.northing = y;
error_code = Set_Van_der_Grinten_Coordinates(Interactive, Input, coord);
break;
}
}
}
return( error_code == 0 );
}
//---------------------------------------------------------
bool CGEOTRANS_Base::Convert_Get(double &x, double &y, double &z)
{
long error_code = -1;
if( bInitialized )
{
switch( Type_Output )
{
default:
return( Convert_Get(x, y) );
case Geocentric:
{
Geocentric_Tuple coord;
error_code = Get_Geocentric_Coordinates(Interactive, Output, &coord);
x = coord.x;
y = coord.y;
z = coord.z;
break;
}
case Geodetic:
{
Geodetic_Tuple coord;
error_code = Get_Geodetic_Coordinates(Interactive, Output, &coord);
x = coord.longitude * M_RAD_TO_DEG;
y = coord.latitude * M_RAD_TO_DEG;
z = coord.height;
break;
}
case Local_Cartesian:
{
Local_Cartesian_Tuple coord;
error_code = Get_Local_Cartesian_Coordinates(Interactive, Output, &coord);
x = coord.x;
y = coord.y;
z = coord.z;
break;
}
}
}
return( error_code == 0 );
}
//---------------------------------------------------------
bool CGEOTRANS_Base::Convert_Get(double &x, double &y)
{
long error_code = -1;
if( bInitialized )
{
switch( Type_Output )
{
default: // case BNG: case GEOREF: case MGRS:
return( false );
case Geocentric:
case Geodetic:
case Local_Cartesian:
double z;
return( Convert_Get(x, y, z) );
case Albers_Equal_Area_Conic:
{
Albers_Equal_Area_Conic_Tuple coord;
error_code = Get_Albers_Equal_Area_Conic_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Azimuthal_Equidistant:
{
Azimuthal_Equidistant_Tuple coord;
error_code = Get_Azimuthal_Equidistant_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Bonne:
{
Bonne_Tuple coord;
error_code = Get_Bonne_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Cassini:
{
Cassini_Tuple coord;
error_code = Get_Cassini_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Cylindrical_Equal_Area:
{
Cylindrical_Equal_Area_Tuple coord;
error_code = Get_Cylindrical_Equal_Area_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Eckert4:
{
Eckert4_Tuple coord;
error_code = Get_Eckert4_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Eckert6:
{
Eckert6_Tuple coord;
error_code = Get_Eckert6_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Equidistant_Cylindrical:
{
Equidistant_Cylindrical_Tuple coord;
error_code = Get_Equidistant_Cylindrical_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Gnomonic:
{
Gnomonic_Tuple coord;
error_code = Get_Gnomonic_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Lambert_Conformal_Conic:
{
Lambert_Conformal_Conic_Tuple coord;
error_code = Get_Lambert_Conformal_Conic_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Mercator:
{
Mercator_Tuple coord;
error_code = Get_Mercator_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Miller_Cylindrical:
{
Miller_Cylindrical_Tuple coord;
error_code = Get_Miller_Cylindrical_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Mollweide:
{
Mollweide_Tuple coord;
error_code = Get_Mollweide_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Neys:
{
Neys_Tuple coord;
error_code = Get_Neys_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case NZMG:
{
NZMG_Tuple coord;
error_code = Get_NZMG_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Oblique_Mercator:
{
Oblique_Mercator_Tuple coord;
error_code = Get_Oblique_Mercator_Coordinates(Interactive, Output, &coord);
x = coord.easting;
y = coord.northing;
break;
}
case Orthographic:
{
Orthographic_Tuple coord;
error_code = Get_Orthogra
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -