mfwdtran

将地理特征投影到地图坐标

语法

[x,y] = mfwdtran(lat,lon)
[x,y,z] = mfwdtran(lat,lon,alt)
[…= mfwdtran(mstruct,…)

描述

[x,y] = mfwdtran(lat,lon)在当前映射轴中应用映射投影定义的正向转换。您可以使用此函数将点位置、线顶点和多边形顶点转换为平面投影地图坐标系统。

[x,y,z] = mfwdtran(lat,lon,alt)对三维输入应用前向投影,得到三维输出。如果输入alt是空的还是省略的alt假设= 0。

[…= mfwdtran(mstruct,…)需要一个有效的映射投影结构作为第一个参数。在这种情况下,不需要映射轴。

例子

全部折叠

获取哥伦比亚特区的地理位置数据。

Dc = shaperead(“usastatelo”“UseGeoCoords”,真的,...“选择器”{@(名字)strcmpi(名称、“哥伦比亚特区”),...“名字”});lat = [dc.Lat]';lon = [dc.Lon]';(lat经度)
ans =10×238.9000 -77.0700 38.9500 -77.1200 39.0000 -77.0300 38.9000 -76.9000 38.7800 -77.0300 38.8000 -77.0200 38.8700 -77.0200 38.9000 -77.0700 38.9000 -77.0700 NaN NaN

获取该点的UTM区域。

Dczone = utmzone(mean(lat,“omitnan”),意味着(朗,“omitnan”))
dczone = '18S'

根据这些信息设置UTM坐标系。

Utmstruct = default (“设备”);utmstruct。Zone = dczone;utmstruct。大地水准面= wgs84椭球;Utmstruct = default (Utmstruct)
utmstruct =带字段的结构:mapprojection: 'utm' zone: '18S' angleunits: 'degrees' aspect: 'normal' falsenorthing: 0 falseeasting: 500000 fixedorient: [] geooid: [1x1 referenceEllipsoid] maplatlimit: [32 40] maplonlimit: [-78 -72] mapparallels: [] nparallels: 0 origin: [0 -75 0] scalefactor: 0.9996 trimlat: [-80 84] trimlon: [-180 180] frame: 'off' ffill: 100 fedgecolor: [32 40] flinewidth: 2 flonlimit: [-3 3] grid: 'off'高度值:Inf gcolor:[0.1500 0.1500 0.1500] glinestyle: ':' glinewidth: 0.5000 mlineexception: [] mlinefill: 100 mlinelimit: [] mlinelocation: 1 mlinevisible: 'on' plineexception: [] plineexception: [] plinefill: 100 plinelimit: [] plinelocation: 1 plinevisible: 'on' fontangle: 'normal' fontcolor: [0.1500 0.1500 0.1500] fontname: 'Helvetica' fontsize: 10 fontunits: 'points' fontweight: 'normal' labelformat: 'compass' labelrotation: 'off' labelunits: 'degrees' meridianlabel: 'off' mlabellocation: 1 mlabelparallel: 40 mlabelround:0 parallelabel: 'off' plabellocation: 1 plabelmeridian: -78 plabelround: 0

将哥伦比亚特区数据从地理坐标投影到UTM区18S的地图坐标。

[x,y] = mfwdtran(utmstruct,lat,lon)
x =10×1105× 3.2049 3.1629 3.2421 3.3524 3.2367 3.2459 3.2476 3.2049 3.2049 NaN
y =10×1106× 4.3077 4.3134 4.3187 4.3074 4.2943 4.2965 4.3043 4.3077 4.3077 NaN

R2006a之前介绍