坐标转换从经纬度坐标到大地坐标及源码.doc_第1页
坐标转换从经纬度坐标到大地坐标及源码.doc_第2页
坐标转换从经纬度坐标到大地坐标及源码.doc_第3页
坐标转换从经纬度坐标到大地坐标及源码.doc_第4页
坐标转换从经纬度坐标到大地坐标及源码.doc_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

坐标转换从经纬度坐标到大地坐标及源码利用网络上开源的资料,可以很容易的实现从经纬度坐标向各种投影坐标的转换,美国地质调查局开发USGS的GCTP就是很好的东西之一,有语言版本的支持各种投影类型的源代码,比如UNIVERSAL TRANSVERSE MERCATOR, ALBERS CONICAL EQUAL AREA ,LAMBERT CONFORMAL CONIC等等,我们机房使用的就是LAMBERT CONFORMAL CONIC(LAMBERT 圆锥等角投影),利用GCTP提供的源代码详见source文件夹下的lamccfor.c和lamccinv.c,可以轻松实现经纬度投影坐标和LAMBERT CONFORMAL CONIC坐标的相互转化,其他投影方式使用的比较少,还要进一步研究,就以后在写了lamccforint函数设置LAMBERT CONFORMAL CONIC投影的各个参数,比如长半轴,短半轴,中心点经纬度坐标,标准纬线等等信息long lamccforint(r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north)double r_maj; /* majoraxis */double r_min; /* minoraxis */double lat1; /* first standard parallel */double lat2; /* second standard parallel */double c_lon; /* center longitude */double c_lat; /* center latitude */double false_east; /* x offset in meters */double false_north; /* y offset in meters */double sin_po; /* sin value */double cos_po; /* cos value */double con; /* temporary variable */double ms1; /* small m 1 */double ms2; /* small m 2 */double temp; /* temporary variable */double ts0; /* small t 0 */double ts1; /* small t 1 */double ts2; /* small t 2 */r_major = r_maj;r_minor = r_min;false_northing = false_north;false_easting = false_east;/* Standard Parallels cannot be equal and on opposite sides of the equator-*/if (fabs(lat1 lat2) EPSLN) ns = log (ms1/ms2)/ log (ts1/ts2);else ns = con;f0 = ms1 / (ns * pow(ts1,ns);rh = r_major * f0 * pow(ts0,ns);/* Report parameters to the user -*/ptitle(LAMBERT CONFORMAL CONIC);radius2(r_major, r_minor);stanparl(lat1,lat2);cenlonmer(center_lon);origin(c_lat);offsetp(false_easting,false_northing);return(OK);lamccfor函数实现输入任意点经纬度值输出此投影下对应的点的大地坐标long lamccfor(lon, lat, x, y)double lon; /* (I) Longitude */double lat; /* (I) Latitude */double *x; /* (O) X projection coordinate */double *y; /* (O) Y projection coordinate */double con; /* temporary angle variable */double rh1; /* height above ellipsoid */double sinphi; /* sin value */double theta; /* angle */double ts; /* small value t */con = fabs( fabs(lat) - HALF_PI);if (con EPSLN) sinphi = sin(lat); ts = tsfnz(e,lat,sinphi); rh1 = r_major * f0 * pow(ts,ns); else con = lat * ns; if (con 0) rh1 = sqrt (x * x y * y); con = 1.0; else rh1 = -sqrt (x * x y * y); con = -1.0; theta = 0.0;if (rh1 != 0) theta = atan2(con * x),(con * y);if (rh1 != 0) | (ns 0.0) con = 1.0/ns; ts = pow(rh1/(r_major * f0),con); *lat

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论